service/pom.xml
This pom file generates the JAX-WS artifacts using CXF's wsdl2java utility that will be used by the web service provider and the SOAP client. The Maven Assembly Plugin is used here to create an additional JAR artifact containing just the JAX-WS objects, which will be later included as a dependency in the client's pom.xml file. JUnit is included for unit testing, which will be shown shortly. The packaging element has a value of "bundle" which will work for both OSGi and servlet deployment, for servlet-only deployment the (very) slightly simpler "jar" value can be used instead.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>dev-guide-wsdl-first-service</artifactId>
<name>-- Web Service Provider</name>
<packaging>bundle</packaging>
<parent>
<groupId>org.talend.cxf-examples.dev-guide-wsdl-first</groupId>
<artifactId>dev-guide-wsdl-first</artifactId>
<version></version>
</parent>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Below plugin provides a separate JAR for the JAX-WS artifacts
(i.e., the objects created by running wsdl2java or wsimport), as this JAR
will also be used by the SOAP client.
More info: http://maven.apache.org/plugins/maven-assembly-plugin/ -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<descriptors>
<descriptor>src/assembly/jaxws-jar.xml</descriptor>
</descriptors>
<appendAssemblyId>true</appendAssemblyId>
<attach>true</attach>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<configuration>
<sourceRoot>
${basedir}/target/generated-sources
</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>
${basedir}/src/main/resources/DoubleIt.wsdl
</wsdl>
<wsdlLocation>classpath:DoubleIt.wsdl</wsdlLocation>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.4.0</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Export-Package>service</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
<!-- Name of the generated WAR file -->
<finalName>doubleit</finalName>
</build>
</project>