How can I make the cxf-codegen-plugin and wsdl2java goal check that the xsd files used by the wsdls have been modified? When I make a change in the xsd and then run mvn verify
it doesn't recompile the jar file.
Snippet of the plugin configuration.
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>3.0.4</version>
<executions>
<execution>
<id>generate-us-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${schemas.location}/usidentityservice.wsdl
</wsdl>
<extraargs>
<extraarg>-all</extraarg>
<extraarg>-impl</extraarg>
<extraarg>-validate</extraarg>
<extraarg> -wsdlLocation
</extraarg>
<extraarg> classpath:/us.wsdl
</extraarg>
</extraargs>
</wsdlOption>
<wsdlOption>
<wsdl>${schemas.location}/usv2.wsdl
</wsdl>
<extraargs>
<extraarg>-all</extraarg>
<extraarg>-impl</extraarg>
<extraarg>-validate</extraarg>
<extraarg> -wsdlLocation
</extraarg>
<extraarg> classpath:/usv2.wsdl
</extraarg>
</extraargs>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
An unfavorable solution would be to put the maven clean plugin so that it cleans each time and doesn't miss the xsd change but this will also clean it every time which makes the build slowed.