Malachi,
Ah, there you are. Thanks for helping!
>> 1. it says that "includeSchemas" was not set, but I set it as per
>> instructions (but told it to recurse subdirectories)
You indeed found a problem (it was missing an important @parameter tag).
The plugin has been fixed and reposted.
Instructions are here:
http://jaxb.dev.java.net/jaxb-maven2-plugin/
>> 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
I'm not clear on what you are describing here. I'm not sure of the steps to
follow to reproduce this. Can you provide more details?
>> how do I enable an external jaxb plugin
This was a feature for the next version. I would image a section in the
configuration section like this...
<classpaths>
<classpath>/path/to/jaxb-xjc.jar</classpath>
<classpath>/path/to/plugin.jar</classpath>
</classpaths >
Which in turn would call XJC2Task.setClasspath(...)
But I'm not sure how to invoke the plugin methods as you can do in an Ant
command
<xjc ...>
<arg value="-Xinject-code" />
... other nested elements ...
</xjc>
Perhaps you or Kohsuke can advise me.
- Jonathan
-----Original Message-----
From: Malachi de Ælfweald [mailto:malachid_at_gmail.com]
Sent: Wednesday, May 17, 2006 11:05 PM
To: users_at_jaxb.dev.java.net
Subject: Re: Maven 2 Jaxb2 plugin available.
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</schemaDir
ectory>
<extension>true</extension>
<verbose>true</verbose>
<includeSchemas>
<includeSchema>**/*.xsd</inc
ludeSchema>
</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(DefaultPluginManage
r.java:415)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife
cycleExecutor.java:531)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
(DefaultLifecycleExecutor.java:472)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifec
ycleExecutor.java:451)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFail
ures(DefaultLifecycleExecutor.java:303)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Defa
ultLifecycleExecutor.java:270)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycle
Executor.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)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net