Maven cxf-codegen-plugin (WSDL to Java)Page edited by Christian SchneiderCXF includes a Maven plugin which can generate java artifacts from WSDL. Here is a simple example: <plugin> <groupId>org.apache.cxf</groupId> <artifactId>cxf-codegen-plugin</artifactId> <version>${cxf.version}</version> <executions> <execution> <id>generate-sources</id> <phase>generate-sources</phase> <configuration> <sourceRoot>${project.build.directory}/generated/cxf</sourceRoot> <wsdlOptions> <wsdlOption> <wsdl>${basedir}/src/main/wsdl/myService.wsdl</wsdl> </wsdlOption> </wsdlOptions> </configuration> <goals> <goal>wsdl2java</goal> </goals> </execution> </executions> </plugin> In this example we're running the wsdl2java goal in the generate-sources phase. By running mvn generate-sources, CXF will generate artifacts in the <sourceRoot> directory that you specify. Each <wsdlOption> element corresponds to a WSDL that you're generated artifacts for. In the above example we're generating we're specifying the WSDL location via the <wsdl> option.
<plugin> <groupId>org.apache.cxf</groupId> <artifactId>cxf-codegen-plugin</artifactId> <version>${cxf.version}</version> <executions> <execution> <id>generate-sources</id> <phase>generate-sources</phase> <configuration> <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot> <wsdlOptions> <wsdlOption> <wsdl>${basedir}/src/main/wsdl/myService.wsdl</wsdl> <extraargs> <extraarg>-xjc-Xts</extraarg> </extraargs> </wsdlOption> </wsdlOptions> </configuration> <goals> <goal>wsdl2java</goal> </goals> </execution> </executions> <dependencies> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-xjc-ts</artifactId> <version>${cxf.version}</version> </dependency> </dependencies> </plugin>
Change Notification Preferences
View Online
|
View Change
|
Add Comment
|
- [CONF] Apache CXF Documentation > Maven cxf-codegen-plugin (... confluence
- [CONF] Apache CXF Documentation > Maven cxf-codegen-plu... confluence
- [CONF] Apache CXF Documentation > Maven cxf-codegen-plu... confluence
- [CONF] Apache CXF Documentation > Maven cxf-codegen-plu... confluence
- [CONF] Apache CXF Documentation > Maven cxf-codegen-plu... confluence
- [CONF] Apache CXF Documentation > Maven cxf-codegen-plu... confluence
