> -----Original Message----- > From: Daniel Kulp [mailto:[email protected]] > Sent: Monday, June 24, 2013 10:31 AM > To: [email protected]; KARR, DAVID > Subject: Re: Why is cxf-xjc-plugin not regenerating source if xsd changes? > > > Can you retry with version 2.6.1? Some code was added in 2.6.1 to support > better integration with m2e which allows the change detection to work a > little bit better. That said, if the schema includes or imports another > schema, it won't detect changes in those schemas and rebuild everything.
It's possible that helped. After changing the version of cxf-xjc-plugin I'm using, I tried making a trivial change to my schema in Eclipse, and the generated class was changed before I could even run the command-line to compare the mod times. :) It wasn't the same test case as I was hitting earlier, as I couldn't wait for an answer on that, so I did a full clean and rebuild. > On Jun 24, 2013, at 12:51 PM, "KARR, DAVID" <[email protected]> wrote: > > > 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</ext > ension> > > <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> > > -- > Daniel Kulp > [email protected] - http://dankulp.com/blog > Talend Community Coder - http://coders.talend.com
