users@jaxb.java.net

Re: maven-jaxb-plugin and xjc plugins

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Fri, 22 Jun 2007 16:15:13 -0700

Perhaps some of
https://jaxb.dev.java.net/guide/Migrating_JAXB_2_0_applications_to_JavaSE_6.html
might help wrt the general problem of running JAXB 2.1 on Mustang.

Hunor Bartha wrote:
> Aleksei Valikov wrote:
>> Hi.
>>
>>
>> but unfortunately it did not work.
>>
>> I'm using Maven2 and JAXB2. Maybe it is related to xjc version 2.x?
>>
>>
>> Well maybe you have to use the maven-jaxb2-plugin then? :))
>>
>> See http://maven-jaxb2-plugin.dev.java.net.
>>
>> Here's an example:
>>
>> <plugin>
>> <groupId>org.jvnet.jaxb2.maven2</groupId>
>> <artifactId>maven-jaxb2-plugin</artifactId>
>> <executions>
>> <execution>
>> <goals>
>> <goal>generate</goal>
>> </goals>
>> <configuration>
>> <extension>true</extension>
>> <schemaIncludes>
>> <schemaInclude>*.xsd</schemaInclude>
>> </schemaIncludes>
>> <args>
>> <arg>-Xfoo</arg>
>> </args>
>> <plugins>
>> <!-- This is the JAXB2 plugin
>> dependency -->
>> <plugin>
>> <groupId>org.jvnet.jaxb2_commons
>> </groupId>
>> <artifactId>basic</artifactId>
>> <version>0.2-SNAPSHOT</version>
>> </plugin>
>> </plugins>
>> </configuration>
>> </execution>
>> </executions>
>> </plugin>
>>
>> Come back any time with questions. Me and Kostis, we are authors'
>> supporters.
>> It's nice to see people writing JAXB2 plugins.
>>
>> Bye.
>> /lexi
> Hello,
>
> I am using the jaxb-maven2-plugin to generate my classes and all works
> fine with java1.5, but when i try to use java 6 it show the following
> exception with the -e switch:
>
> org.apache.maven.lifecycle.LifecycleExecutionException: Unable to parse
> input schema(s). Error messages should have bee
> n provided.
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:47
> 5)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:454)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.jav
> a:306)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to
> parse input schema(s). Error messages should have
> been provided.
> at
> org.jvnet.jaxb2.maven2.AbstractXJC2Mojo.runXJC(AbstractXJC2Mojo.java:460)
> at
> org.jvnet.jaxb2.maven2.AbstractXJC2Mojo.executeImp(AbstractXJC2Mojo.java:132)
> at org.jvnet.jaxb2.maven2.XJC2Mojo.execute(XJC2Mojo.java:320)
> at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
> ... 16 more
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 10 seconds
> [INFO] Finished at: Thu Jun 14 16:57:55 EEST 2007
> [INFO] Final Memory: 4M/35M
> [INFO]
> ------------------------------------------------------------------------
>
> At first i showed the famous conflict message with the jaxb2.0-api, but
> after i played around a bit with the -U switch now i get this error, and
> i am unable to figure out why.
>
> My second question would be that under normal circumstances how is it
> possble to get the maven2-jaxb plugin to compile witht java6?
>
> Thanks in advance,
>
> hunor
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com