Easily expose JAXWS in PEtALS with Maven
26/05/2009
Since I am always using command line tools such as Maven or Ant to create my project and to package them, I have just created a new Maven plugin to easily and quickly expose a JAXWS service in PEtALS with Maven. This plugin will generate the JBI Service Unit and Service Assembly from a Maven java project with just a few lines of Maven settings…
As an example, the following interface :
package org.ow2.petals; import javax.jws.WebMethod; import javax.jws.WebService; @WebService public interface Service { @WebMethod String ping(String input); }
and its implementation :
package org.ow2.petals; public class ServiceImpl implements Service { public String ping(String input) { return input; } }
will generate a Service Assembly idirectly deployable to PEtALS by the help of the Maven plugin :
<build> <plugins> <plugin> <groupId>org.ow2.petals</groupId> <artifactId>maven-petals-jaxws2jbi</artifactId> <version>1.0-SNAPSHOT</version> <executions> <execution> <id>generate-jbi</id> <phase>package</phase> <configuration> <className> org.ow2.petals.ServiceImpl </className> </configuration> <goals> <goal>java2jbi</goal> </goals> </execution> </executions> </plugin> </plugins> </build>
The plugin takes the Service class, generates its associated WSDL file and the JBI descriptor and then package all into a Service Assembly.