users@jaxb.java.net

Re: maven-jaxb-plugin and xjc plugins

From: Hunor Bartha <hunor.bartha_at_ambo.ro>
Date: Thu, 14 Jun 2007 17:02:27 +0300

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