users@jaxb.java.net

Re: Maven 2 Jaxb2 plugin available.

From: Malachi de Ælfweald <malachid_at_gmail.com>
Date: Wed, 17 May 2006 20:04:40 -0700

Sorry it took me so long to test it... I noticed a couple problems....

1. it says that "includeSchemas" was not set, but I set it as per
instructions (but told it to recurse subdirectories)
2. instead of running under reactor, it tried to run on the outside
pom which has no source code -- and thus hard crashed the build
3. how do I enable an external jaxb plugin

My configuration (on outside reactor pom.xml, not individual project):

                        <plugin>
                                <groupId>com.sun.tools.xjc.maven2</groupId>
                                <artifactId>maven-jaxb-plugin</artifactId>
                                <executions>
                                        <execution>
                                                <goals>
                                                        <goal>generate</goal>
                                                </goals>
                                        </execution>
                                </executions>
                                <configuration>
                                        <schemaDirectory>src/main</schemaDirectory>
                                        <extension>true</extension>
                                        <verbose>true</verbose>
                                        <includeSchemas>
                                                <includeSchema>**/*.xsd</includeSchema>
                                        </includeSchemas>
                                </configuration>
                        </plugin>


Result:

[INFO] [jaxb:generate {execution: default}]
[INFO] The <includeSchemas> setting was not defined, assuming *.xsd.
[INFO] The <includeBindings> setting was not defined, assuming *.xjb.
[INFO] schemaDirectory: C:\development\devel.eoti.org\src\main
[INFO] includeSchemas: [*.xsd]
[INFO] excludeSchemas: null
[INFO] includeBindings: [*.xjb]
[INFO] excludeBindings: null
[INFO] generatePackage: null
[INFO] generateDirectory:
C:\development\devel.eoti.org\target\generated-sources\xjc
[INFO] readOnly: false
[INFO] extension: true
[INFO] catalog: null
[INFO] removeOldOutput: false
[INFO] strict: true
[INFO] verbose: true
[INFO] ----------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ----------------------------------------------------------------------------
[INFO] basedir C:\development\devel.eoti.org\src\main does not exist
[INFO] ----------------------------------------------------------------------------
[INFO] Trace
java.lang.IllegalStateException: basedir
C:\development\devel.eoti.org\src\main does not exist
        at org.apache.tools.ant.DirectoryScanner.scan(DirectoryScanner.java:645)
        at com.sun.tools.xjc.maven2.XJCMojo.getFiles(XJCMojo.java:413)
        at com.sun.tools.xjc.maven2.XJCMojo.execute(XJCMojo.java:194)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:531)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
        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:249)
        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:589)
        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)