Pages

Sunday, August 25, 2013

Maven jax-ws plugin usage

This post shows an example of jax-ws maven plug-in usage. This maven plug-in can be found in two repositories
  1. org.codehaus.mojo
  2. org.jvnet.jax-ws-commons
First repository contains old versions of this plug-in. ( available upto versions 1.12 ). Second one has the Latest version (2.3) and it can be found in http://jax-ws-commons.java.net/jaxws-maven-plugin/. To use latest version, replace groupID and version fields with following .


 <groupid>org.jvnet.jax-ws-commons</groupid>
 <artifactid>jaxws-maven-plugin</artifactid>
 <version>2.3</version>


<plugins>
<!-- usage of jax-ws maven plugin-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>1.12</version>
<executions>
<execution>
<id>wsimport-from-jdk</id>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<configuration>
<!--wsdls file directory -->
<wsdlDirectory>src/main/resources/wsdls</wsdlDirectory>
<!-- which wsdl file -->
<wsdlFiles>
<wsdlFile>echo.wsdl</wsdlFile>
</wsdlFiles>
<!-- Keep generated files -->
<keep>true</keep>
<!-- Package name -->
<packageName>org.example.echo.service.skeleton</packageName>
<!-- generated source files destination-->
<sourceDestDir>target/generated-code/src</sourceDestDir>
</configuration>
</plugin>
<!-- adding generated source -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-code/src</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
...
<plugins>
view raw partial_pom.xml hosted with ❤ by GitHub

No comments:

Post a Comment