How to specify an interface for wsdl2java in pom.xml?

I found this great tip about adding -fe jaxws21 to the wsdl2java command so that it generates jaxws 2.1 compatible code instead of 2.2, but Maven pom.xml doesn’t look like this addition when placed as follows:

  <goals> <goal>wsdl2java -fe jaxws21</goal> </goals> 

What is the correct way to specify the interface for wsdl2java that is used in pom.xml?

+7
source share
3 answers

If you use cxf-codegen-plugin, you can add arguments to the extraargs element:

 <executions> <execution> <configuration> <wsdlOptions> <wsdlOption> <wsdl>...</wsdl> <extraargs> <extraarg>-fe</extraarg> <extraarg>jaxws21</extraarg> </extraargs> </wsdlOption> </wsdlOptions> </configuration> <goals> <goal>wsdl2java</goal> </goals> </execution> </executions> 

Source: http://cxf.apache.org/docs/maven-cxf-codegen-plugin-wsdl-to-java.html

+13
source

You can use <frontEnd> inside <wsdlOption> or <defaultOption> . The latter is useful if you have enabled multiple <wsdlRoot> and specified <wsdlRoot> :

 <executions> <execution> <configuration> <defaultOptions> <frontEnd>jaxws21</frontEnd> </defaultOptions> <wsdlRoot>${basedir}/src/main/wsdl</wsdlRoot> <includes> <include>*.wsdl</include> </includes> </configuration> <goals> <goal>wsdl2java</goal> </goals> </execution> </executions> 
+2
source

To complement @fishbone and @ tafit3 answers, see Also Could not find the jaxws21 frontend in the classpath, because it looks like the frontend was added in the minor version of cxf.

I tried their answers, but it worked only after updating cxf-codegen-plugin to 2.3.11

0
source

All Articles