JAXB2 Maven Plugin not reading Configuration
I am trying to generate some JAXB classes via my schema. I have my jaxb2 maven plugin configured the following way.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.3.1</version>
<executions>
开发者_运维百科 <execution>
<id>xjc</id>
<goals>
<goal>xjc</goal>
</goals>
<configuration>
<packageName>aces.soa.schema</packageName>
<generateDirectory>${project.build.directory}/generated-sources</generateDirectory>
<schemaDirectory>${basedir}/src/main/resources/schema/ea</schemaDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
When running the mvn jaxb2:xjc it complains that it cannot find the Schema, which is in the src/main/resources/schema/ea directory. When executing mvn -X jaxb2:xjc I see that the variables are not getting set at all. Is there something else I need to do to configure the plugin propoerly?
There's an issue with running this plugin with configuration elements in the execution elements, when the plugin is being called using:
mvn jaxb2:xjc
A workaround for me was using:
mvn generate-sources
Actually no. Having configuration outside executions configures the plugin globally. Here is the doc: http://mojo.codehaus.org/jaxb2-maven-plugin/usage.html
So, you should be able to configure each execution but it does not work some reason :( The question is still valid
精彩评论