JAX-WS Maven and NetBeans
I am using netbeans 7 very successfully with JDK6. I need to add a JAX-WS webservice[ws] interface to my application to consume EJB service already created in the app. Since I moved to maven2 I had no issues with deployments on glassfish v3.1 and it seemed to work all fine apart from the new ws.
here is the list of issues I still have:
- WS are not deployed and the WSDL are not generated
- issues with the root context is nt recognised and the test WS is just after the localhost address.
- I cannot configure security constrain for the WS, there is a JACC error and the WS is not available
I used to be able to secure the ws (Ant) with simple web.xml BASIC auth but with maven this is not working any more. I created a test Ant project and everything is working fine.
I think the solution is in the pom.xml (archetype?) where the correct build plug-ins are included? I am not sure what code to include part from the pom.xml I am using.
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
....
<groupId>com</grou开发者_如何转开发pId>
<artifactId>at.web.ws</artifactId>
<version>3.4.2</version>
<packaging>war</packaging>
<name>at.web.ws Web App</name>
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>webservices-rt</artifactId>
<version>2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<failOnMissingWebXml>true</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${endorsed.dir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>6.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<url>http://download.java.net/maven/2/</url>
<id>metro</id>
<layout>default</layout>
<name>Repository for library Library[metro]</name>
</repository>
</repositories>
any advise will be appreciated. thanks in advance.
I answered my own question :)
I found this amazing plugin that looks after everything and make sure it is all deployed under the ear project.
http://el4j.sourceforge.net/plugins/index.html
I hope this will help someone Cheers, G.
精彩评论