Jersey + JPA deployment on Glassfish not working without restart - eclipse

For a webapp project, I am using Eclipse + Jax-RS Jersey 2.5 + JPA 2.0, and I am facing some weird problems after deploying the application on Glassfish server from Eclipse.
In fact, everything works fine if I hit "Run on server", let the deployment end and then restart the Glassfish server ; btw, it's not very effective when developing, 'cause it leads to a lot a wasted time...
If I just hit "Run on server", then none of my EJB's are being injected, resulting in NullPointerException that prevent me from doing anything.
I used Maven for dependencies management, could it come from it ? Should I use another way than "Run on server" to redeploy my application after code change ?
Thanks
EDIT : Here is the architecture of the project :
src/
main/
java/
/* Application packages */
resources/
META-INF/
persistence.xml
webapp/
WEB(INF/
beans.xml
/* App templates */
pom.xml
EDIT 2 :
Even with this script it does not work :
/opt/apache-maven-3.1.1/bin/mvn clean package
/opt/glassfish4/glassfish/bin/asadmin --host localhost --port 4848 --user admin --passwordfile /opt/glassfish4/glassfish/domains/domain1/config/admin-keyfile --interactive=false --echo=true --terse=false undeploy --keepreposdir=true --isredeploy=false --cascade=false --_ignorecascade=false --_classicstyle=false configurator
/opt/glassfish4/glassfish/bin/asadmin --host localhost --port 4848 --user admin --passwordfile /opt/glassfish4/glassfish/domains/domain1/config/admin-keyfile --interactive=false --echo=true --terse=false deploy --name configurator --force=false --precompilejsp=false --verify=false --generatermistubs=false --availabilityenabled=false --asyncreplication=true --keepreposdir=true --keepfailedstubs=false --isredeploy=false --logreportederrors=true --_classicstyle=false --upload=false /home/jeremy/workspace-configurator-v2/trunk/configurator/target/configurator.war
EJB are injected with EJB annotation, and specifying the LOOKUP name :
#EJB( name=CustomApplicationService.LOOKUP_NAME )
private CustomApplicationService customApplicationService;
Class :
#Stateless
public class CustomApplicationService {
public final static String LOOKUP_NAME = "java:global/configurator/CustomApplicationService";
#PersistenceContext( name=UtilConsts.DATABASE_POOL )
private EntityManager em;
/**** */
}
Finally, my pom.xml :
<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>
<groupId>com.virtualsensitive</groupId>
<artifactId>configurator</artifactId>
<packaging>war</packaging>
<version>2</version>
<name>configurator</name>
<dependencies>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>2.5.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>2.5.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
<version>2.5.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.ejb</artifactId>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.servlet</artifactId>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom2</artifactId>
<version>2.0.5</version>
</dependency>
</dependencies>
<build>
<finalName>configurator</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<inherited>true</inherited>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<jersey.version>2.5.1</jersey.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

Related

Deployment assembly of a Maven's Springboot project in Eclipse

Trying to deploy a SpringBoot Maven project on my Tomcat in Eclipse.
First problem: the lib directory is empty after deployment, Maven is not doing the job although the dependencies are in the Build Path.
First solution: i added manually my Maven's dependencies to the deployment structure in Property > Deployment Assembly, and this worked fine.
Second problem: each and everytime i update my Maven's project, the Deployment Assembly goes back to the original state (no Maven's dependencies in WAR) and again i have to do the job manually.
Tried everything i could, everything i've found here, still not working.
My pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>***</groupId>
<artifactId>***</artifactId>
<version>***</version>
<packaging>war</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.2.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>***</finalName>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
My Eclipse Maven plugin installation just in case:
Found the answer here.
I did not have m2e-wtp plugin installed, this fixed my problem.

Wrong Maven Exception

I am trying to make a new project in eclipse using Maven.
And I used simple "struts-archetype-blank" template of struts.
There is no spring dependencies in it. Still I am getting missing spring artifact error.
Is there any way to resolve the same? Or I am doing something wrong?
Here is an information pom.xml file
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.krb</groupId>
<artifactId>MySamaj</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>MySamaj</name>
<properties>
<struts2.version>2.5.5</struts2.version>
<log4j2.version>1.2.15</log4j2.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>${struts2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-config-browser-plugin</artifactId>
<version>${struts2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-junit-plugin</artifactId>
<version>${struts2.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.16.v20140903</version>
<configuration>
<stopKey>CTRL+C</stopKey>
<stopPort>8999</stopPort>
<systemProperties>
<systemProperty>
<name>xwork.loggerFactory</name>
<value>com.opensymphony.xwork2.util.logging.log4j2.Log4j2LoggerFactory</value>
</systemProperty>
</systemProperties>
<scanIntervalSeconds>10</scanIntervalSeconds>
<webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
<webAppConfig>
<descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
</webAppConfig>
</configuration>
</plugin>
</plugins>
</build>
You are using struts2-junit-plugin which has transitive dependencies to Spring. Those dependencies are also available from the central Maven repository. For example spring-beans-4.1.6.RELEASE
Why the resolving of dependencies is not working cannot be seen in your question. It could be everything from misconfiguration (e.g. settings.xml, private repository, authentication) to network problems (e.g. private repository not reachable).
Your log4j2 version is also wrong. All log4j2 versions start with 2.the current version is 2.8.

Maven not updating EAR with latest code in workspace after maven-install

I have a multi-module maven spring project with a main parent module(parent pom):
project
project-client
project-ear
project-filenet
project-jaxws
project-webservice
project-service-util
project-properties
When a maven clean install is performed the resulting EAR file does not have the updated version of project-jaxws, project-service-util and project-filenet module.
I have repeatedly tried recleaning it and installing it, restarting STS, restarting the machine but to no avail. Please explain why maven behaves this way and what to do to make maven build the EAR properly.
Parent pom:
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.abc.technology.maven</groupId>
<artifactId>global-parent</artifactId>
<version>24</version>
</parent>
<artifactId>project</artifactId>
<groupId>com.abc.technology</groupId>
<version>2.0.0.1-RC10-SNAPSHOT</version>
<packaging>pom</packaging>
<name>abc project Application</name>
<description>abc project web service and application</description>
<properties>
<!-- You will need to modify this property. It must point to the root of
your projects trunk/tags/branches structure. It is used by the Jenkins
Branch, Snapshot and Formal release builds to determine the correct locations
for publishing of tags and branches. It is also used in the Maven SCM section
below until the first Snapshot release at which point it will be token replaced
with the full value -->
<svn.root>${svn.base.url}/Technology/project</svn.root>
<!-- No requirement to statically analyse generated code -->
<sonar.skippedModules>project-ear</sonar.skippedModules>
<sonar.exclusions>com/ibm/**/*.java,org/**/*.java,**/EJS*.java,**com/abc/services/exceptions/*.java,**com/abc/services/common/commondatatypes/v1/*.java,**com/abc/services/framework/abcheader/v1/*.java,**com/abc/services/technology/documentdsm/v1/*.java,**com/abc/services/technology/enterprisedocumentservicecomponents/v1/*java,**com/abc/technology/project/contract/v1/*.java,**com/abc/technology/project/service/v1/*.java,**com/abc/technology/project/constants/*.java</sonar.exclusions>
<target.jdk>1.7</target.jdk>
</properties>
<scm>
<connection>scm:svn:${svn.root}/branches/project-2.0.0</connection>
<developerConnection>scm:svn:${svn.root}/branches/project-2.0.0</developerConnection>
<url>http://kau1p464.abc.com/svn/Technology/project/branches/project-2.0.0</url>
</scm>
<!-- Dependencies which are global to all modules -->
<dependencies>
<!-- Test dependencies, not present in application assembly -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<!-- Only required to support STS / Eclipse compilation
Has "provided" scope in global-parent pom -->
<dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
</dependency>
</dependencies>
<modules>
<module>project-filenet</module>
<module>project-service-util</module>
<module>project-webservice</module>
<module>project-jaxws</module>
<module>project-client</module>
<module>project-ear</module>
<module>project-properties</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.abc.tech.framework</groupId>
<artifactId>service-invocation</artifactId>
<version>1.0.0.5</version>
</dependency>
<dependency>
<groupId>com.abc.technology.services</groupId>
<artifactId>manageform-client</artifactId>
<version>1.0.0.1</version>
</dependency>
<dependency>
<groupId>com.abc.tech.framework</groupId>
<artifactId>service-invocation-cxf</artifactId>
<version>1.0.0.6</version>
</dependency>
<dependency>
<groupId>com.abc.technology.framework</groupId>
<artifactId>webservicerouting</artifactId>
<version>1.0.0.0</version>
<exclusions>
<exclusion>
<artifactId>jaxws-rt</artifactId>
<groupId>com.sun.xml.ws</groupId>
</exclusion>
<exclusion>
<artifactId>istack-commons-runtime</artifactId>
<groupId>com.sun.istack</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.7.4</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
project-jaxws pom:
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>project</artifactId>
<groupId>com.abc.technology</groupId>
<version>2.0.0.1-RC10-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>project-jaxws</artifactId>
<packaging>jar</packaging>
<name>abc project JAXWS Jar</name>
<description>Implements the technology layer for exposing the abc project service via JAXWS</description>
<dependencies>
<!-- business contract definition (Service interface and domain objects) -->
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>project-filenet</artifactId>
<version>${project.parent.version}</version>
</dependency>
<!-- abc service invocation framework support -->
<dependency>
<groupId>com.abc.tech.framework</groupId>
<artifactId>service-invocation</artifactId>
</dependency>
<dependency>
<groupId>com.abc.tech.framework</groupId>
<artifactId>service-invocation-cxf</artifactId>
</dependency>
<!-- This dependency is provided at Runtime by a concrete implementation,
it is required to be referenced here to support compile time -->
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
</dependency>
<!-- JSR 181 support
Only required to support STS / Eclipse compilation. Has "provided" scope
in global-parent pom -->
<dependency>
<groupId>javax.jws</groupId>
<artifactId>jsr181-api</artifactId>
</dependency>
<!-- JSR 250 support
Only required to support STS / Eclipse compilation. Has "provided" scope
in global-parent pom -->
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-common-utilities</artifactId>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-tools-common</artifactId>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
</dependency>
<!-- Logging support -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
<!-- Support for AOP application of abc standard logging -->
<dependency>
<groupId>com.abc.tech.framework</groupId>
<artifactId>aspect-logging</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
</dependency>
<dependency>
<groupId>com.ibm.filenet.p8</groupId>
<artifactId>jace</artifactId>
<version>4.0</version>
</dependency>
<dependency>
<groupId>${project.parent.groupId}</groupId>
<artifactId>project-service-util</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
</dependency>
<dependency>
<groupId>com.abc.technology.framework</groupId>
<artifactId>webservicerouting</artifactId>
</dependency>
<dependency>
<groupId>com.abc.technology.services</groupId>
<artifactId>manageform-client</artifactId>
<version>1.0.0.1</version>
</dependency>
<dependency>
<groupId>com.abc.technology.eal</groupId>
<artifactId>ealframework</artifactId>
<version>1.0.0.0-RC2-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<!-- This profile is active by default and will weave the logging aspects
into your byte code. The profile however may be disabled by running your
maven command line with the -P !weave-aspects switch, e.g. mvn clean install
-P !weave-aspects This is often useful when carrying out remote debugging
in the development environment as it removes the noise of the woven aspect
when tracing the execution path -->
<profiles>
<!-- <profile>
<id>weave-aspects</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>${aspectj.maven.plugin.version}</version>
</plugin>
</plugins>
</reporting>
</profile> -->
<profile>
<id>generate-service-classes</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>2.6.6</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${project.build.sourceDirectory}</sourceRoot>
<wsdlRoot>${basedir}/src/main/resources/wsdl</wsdlRoot>
<wsdlOptions>
<!-- <wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/ManageDocument/Technology-ManageDocument.wsdl</wsdl>
<bindingFiles>
<bindingFile>${basedir}/src/main/resources/jaxws/jaxws-binding.xml</bindingFile>
</bindingFiles>
<extraargs>
Argument generates the JAX-WS service endpoint implementation class
<extraarg>-impl</extraarg>
<extraarg>-verbose</extraarg>
<extraarg>-wsdlLocation</extraarg>
<extraarg />
<extraarg>-p</extraarg>
<extraarg>http://services.abc.com/Technology/ManageDocument/service/v1=com.abc.technology.managedocument.service.v1</extraarg>
<extraarg>-p</extraarg>
<extraarg>http://services.abc.com/Technology/ManageDocument/contract/v1=com.abc.technology.managedocument.contract.v1</extraarg>
<extraarg>-nexclude</extraarg>
<extraarg>http://services.abc.com/framework/abcHeader/v2</extraarg>
</extraargs>
</wsdlOption> -->
<!-- <wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/RetrieveDocument/Technology-RetrieveDocument.wsdl</wsdl>
<bindingFiles>
<bindingFile>${basedir}/src/main/resources/jaxws/jaxws-binding.xml</bindingFile>
</bindingFiles>
<extraargs>
Argument generates the JAX-WS service endpoint implementation class
<extraarg>-impl</extraarg>
<extraarg>-verbose</extraarg>
<extraarg>-wsdlLocation</extraarg>
<extraarg />
<extraarg>-p</extraarg>
<extraarg>http://services.abc.com/Technology/RetrieveDocument/service/v1=com.abc.technology.retrievedocument.service.v1</extraarg>
<extraarg>-p</extraarg>
<extraarg>http://services.abc.com/Technology/RetrieveDocument/contract/v1=com.abc.technology.retrievedocument.contract.v1</extraarg>
<extraarg>-nexclude</extraarg>
<extraarg>http://services.abc.com/framework/abcHeader/v2</extraarg>
</extraargs>
</wsdlOption> -->
<wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/RetrieveDocumentMetadata/Technology-RetrieveDocumentMetadata.wsdl</wsdl>
<bindingFiles>
<bindingFile>${basedir}/src/main/resources/jaxws/jaxws-binding.xml</bindingFile>
</bindingFiles>
<extraargs>
<!-- Argument generates the JAX-WS service endpoint implementation class -->
<extraarg>-impl</extraarg>
<extraarg>-verbose</extraarg>
<extraarg>-wsdlLocation</extraarg>
<extraarg />
<extraarg>-p</extraarg>
<extraarg>http://services.abc.com/Technology/RetrieveDocumentMetadata/service/v1=com.abc.technology.retrievedocumentmetadata.service.v1</extraarg>
<extraarg>-p</extraarg>
<extraarg>http://services.abc.com/Technology/RetrieveDocumentMetadata/contract/v1=com.abc.technology.retrievedocumentmetadata.contract.v1</extraarg>
<extraarg>-nexclude</extraarg>
<extraarg>http://services.abc.com/framework/abcHeader/v2</extraarg>
</extraargs>
</wsdlOption>
<!-- <wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/SearchDocument/Technology-SearchDocument.wsdl</wsdl>
<bindingFiles>
<bindingFile>${basedir}/src/main/resources/jaxws/jaxws-binding.xml</bindingFile>
</bindingFiles>
<extraargs>
Argument generates the JAX-WS service endpoint implementation class
<extraarg>-impl</extraarg>
<extraarg>-verbose</extraarg>
<extraarg>-wsdlLocation</extraarg>
<extraarg />
<extraarg>-p</extraarg>
<extraarg>http://services.abc.com/Technology/SearchDocument/service/v1=com.abc.technology.searchdocument.service.v1</extraarg>
<extraarg>-p</extraarg>
<extraarg>http://services.abc.com/Technology/SearchDocument/contract/v1=com.abc.technology.searchdocument.contract.v1</extraarg>
<extraarg>-nexclude</extraarg>
<extraarg>http://services.abc.com/framework/abcHeader/v2</extraarg>
</extraargs>
</wsdlOption> -->
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<properties>
<sonar.exclusions>com/ibm/**/*.java,org/**/*.java,**/EJS*.java,**com/abc/services/exceptions/*.java,**com/abc/services/common/commondatatypes/v1/*.java,**com/abc/services/framework/abcheader/v1/*.java,**com/abc/services/technology/documentdsm/v1/*.java,**com/abc/services/technology/enterprisedocumentservicecomponents/v1/*java,**com/abc/technology/project/contract/v1/*.java,**com/abc/technology/project/service/v1/*.java</sonar.exclusions>
</properties>
</project>

unable to run cucumber test using maven build run configuration

I am trying to run cucumber tests in eclipse using maven build as run configuration.
When i run the configuration, build is getting success but browser does not invoke. Hence the test is not running.
Tests are getting skipped, giving an info "Nothing to compile - all classes are up to date".
I am able to run the same test successfully by running the feature file as cucumber feature.
Please suggest me why tests are getting skipped. Also let me know the steps for running the cucumber test as maven build.
Below is the pom.xml that i am using.
Also i am using vm arguments as "-Dcucumber.Options=--format html:target/cucumber-html-report --tags #Runme"
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Maven.Project</groupId>
<artifactId>testMaven</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Maven.Project-v1-testMaven</name>
<properties>
<corporate.test.url>http://google.com</corporate.test.url>
<corporate.test.browser>Firefox</corporate.test.browser>
<corporate.selenium.url>http://localhost:8888/wd/hub</corporate.selenium.url>
</properties>
<dependencies>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.1.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.1.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.42.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.9</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-exec</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>test</id>
<properties>
<corporate.test.url>http://acc-about.hm.com</corporate.test.url>
<corporate.test.browser>Firefox</corporate.test.browser>
<corporate.selenium.url>http://localhost:8888/wd/hub</corporate.selenium.url>
</properties>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.10</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
</build>
</project>
Please remove the skiptests tag in your maven - surefire plugin...
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.10</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
EDIT:
please add the following lines in configuration
<suiteXmlFiles>
<suiteXmlFile>${basedir}${suiteFile}</suiteXmlFile>
</suiteXmlFiles>
<reportsDirectory>./test-output/archive/${timestamp}</reportsDirectory>
In here suiteXmlFile points to your xml file you are trying to run and reportsDirectory points to your output folder. In command line or if using eclipse in goal provide clean test -DsuiteFile=
Hope tthis would help.

Maven tomcat plugin does not allow stepping into dependent jars

I am using the Maven Tomcat plugin to test a Maven webservice project using Hibernate.
My POM looks like this:
<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>
<groupId>com.honeywell.gt</groupId>
<artifactId>WSOCCMeoReports</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>Simple CXF project using spring configuration</name>
<description>Simple CXF project using spring configuration</description>
<properties>
<shiro.version>1.2.1</shiro.version>
<spring.version>3.1.2.RELEASE</spring.version>
<cxf.version>2.6.1</cxf.version>
<hibernate.version>3.6.5.Final</hibernate.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${cxf.version}</version>
</dependency>
<!--
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>${hibernate.version}</version>
</dependency> -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-core</artifactId>
<version>${shiro.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-web</artifactId>
<version>${shiro.version}</version>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-spring</artifactId>
<version>${shiro.version}</version>
</dependency>
<dependency>
<groupId>com.sybase.jdbc</groupId>
<artifactId>SybDriver</artifactId>
<version>3.0.0</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<!-- mvn clean install tomcat:run-war to deploy
Look for "Running war on http://xxx" and
"Setting the server's publish address to be /yyy"
in console output; WSDL browser address will be
concatenation of the two: http://xxx/yyy?wsdl
-->
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<executions>
<execution>
<id>start-tomcat</id>
<goals>
<goal>run-war</goal>
</goals>
<phase>pre-integration-test</phase>
<configuration>
<port>${test.server.port}</port>
<path>/webservice</path>
<fork>true</fork>
<useSeparateTomcatClassLoader>true</useSeparateTomcatClassLoader>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<projectNameTemplate>[artifactId]-[version]</projectNameTemplate>
<wtpmanifest>true</wtpmanifest>
<wtpapplicationxml>true</wtpapplicationxml>
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
The Debug goals are tomcat:run-war
After hitting a break point in the service I cannot step into third party dependencies such as Hibernate. However, if I run a Unit test from the same Maven web service project, I can step into Hibernate.
EDIT 1:
I ran into this and got some ideas about attaching source. Matter of fact, I am trying to debug Hibernate, so I edited source lookup and added paths to the following external archives in my .m2 repository:
hibernate-entitymanager-3.6.5.Final
hibernate-core-3.6.5.Final.
Saved changes and Eclipse still cannot find source to step into. Anyone out there?
Problem appears to be a know issue with Maven Plugin for Eclipse as indicated here.
This post was helpful but I found out that for hibernate 3.6.5, I had to add hibernate-core-3.6.5.Final-sources.jar to source lookup path instead of hibernate-core-3.6.5.Final.jar.