Java Reference
In-Depth Information
Using wsimport in a Maven Project
Problem
You want to create a web client project using Maven 2, and you need to run wsimport as part
of the build.
Solution
Use the jaxws-maven-plugin from Java.net.
Discussion
If you're comfortable with Maven, just download the plug-in and get started at https://jax-ws-
commons.dev.java.net/jaxws-maven-plugin/ .
This plug-in started as a project at Codehaus, but in 2007 all work on it was transferred to the
Java.net website that is also home to Glassfish, Metro, OpenESB, and related projects.
The plug-in is easy to use, and works well out of the box. All you need to do is specify the
plug-in in your pom.xml, as shown in Example 6-8 .
Example6-8.Maven 2 POM using the JAX-WS plug-in
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>1.9</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<configuration>
<packageName>com.example</packageName>
<wsdlUrls>
<wsdlUrl>${my.wsdl.url}</wsdlUrl>
</wsdlUrls>
<verbose>true</verbose>
</configuration>
Search WWH ::




Custom Search