KARR, DAVID
2013-06-24 16:51:40 UTC
I've noticed that if I change my XSD and rebuild, using the cxf-xjc-plugin, that the source is not regenerated. If I instead "clean" and rebuild, it regenerates the source. It seems reasonable that it should know to regenerate the source if only the xsd changes. The documentation at <http://cxf.apache.org/cxf-xjc-plugin.html> is somewhat ambiguous. The only reference to regenerating source is in the undocumented "dependencies" element. I tried some guesses on what should be in the "dependencies" element. I got it to not fail the build, but it didn't appear to do anything, either.
The following is my approximate plugin declaration.
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-xjc-plugin</artifactId>
<version>2.6.0</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>xsdtojava</goal>
</goals>
<configuration>
<extensions>
<extension>JAXBXMLElementWrapperPlugin:JAXBXMLElementWrapperPlugin:1.0.0</extension>
<extension>net.java.dev.jaxb2-commons:jaxb-fluent-api:2.1.8</extension>
</extensions>
<xsdOptions>
<xsdOption>
<xsd>${basedir}/src/main/resources/schema/serviceCallResults.xsd</xsd>
<packagename>packagepath.service.domain.serviceCallResults</packagename>
<extension>true</extension>
<extensionArgs>
<extensionArg>-Xxew</extensionArg>
<extensionArg>-summary ${basedir}/target/xew-summary.txt</extensionArg>
<extensionArg>-instantiate lazy</extensionArg>
<extensionArg>-Xfluent-api</extensionArg>
</extensionArgs>
</xsdOption>
...
</xsdOptions>
</configuration>
</execution>
</executions>
</plugin>
The following is my approximate plugin declaration.
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-xjc-plugin</artifactId>
<version>2.6.0</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>xsdtojava</goal>
</goals>
<configuration>
<extensions>
<extension>JAXBXMLElementWrapperPlugin:JAXBXMLElementWrapperPlugin:1.0.0</extension>
<extension>net.java.dev.jaxb2-commons:jaxb-fluent-api:2.1.8</extension>
</extensions>
<xsdOptions>
<xsdOption>
<xsd>${basedir}/src/main/resources/schema/serviceCallResults.xsd</xsd>
<packagename>packagepath.service.domain.serviceCallResults</packagename>
<extension>true</extension>
<extensionArgs>
<extensionArg>-Xxew</extensionArg>
<extensionArg>-summary ${basedir}/target/xew-summary.txt</extensionArg>
<extensionArg>-instantiate lazy</extensionArg>
<extensionArg>-Xfluent-api</extensionArg>
</extensionArgs>
</xsdOption>
...
</xsdOptions>
</configuration>
</execution>
</executions>
</plugin>