I've been looking around for a while and can't find a definite method to build Maven incrementally in Eclipse.
Currently Maven produces a .war file each time I make a change, which takes some time to compile during the the regular build process.
What's the easiest method to speed things up and just copy across the delta changes into a directory instead?
My pom.xml file:
<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.mkyong.common</groupId>
<artifactId>SpringMVC</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>SpringMVC Maven Webapp</name>
<url>http://maven.apache.org</url>
<properties>
<spring.version>3.1.2.RELEASE</spring.version>
</properties>
<dependencies>
<!-- Spring 3 dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- JSON -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.8</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.8</version>
</dependency>
<!-- DHTMLX -->
<dependency>
<groupId>com.mylaensys.dhtmlx.adapter</groupId>
<artifactId>mylaensys-dhtmlx-adapter</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
<build>
<finalName>SpringMVC</finalName>
<plugins>
<plugin>
<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-war-plugin</artifactId>
<version>2.0.2</version>
<!-- <version>2.1-beta-1</version> -->
<configuration>
<overlay>
<excludes>
META-INF/**,scripts/menu.js,WEB-INF/*.txt,WEB-INF/jboss-web.xml,WEB-INF/web.xml
</excludes>
</overlay>
<archiveClasses>true</archiveClasses>
<warSourceDirectory>
src/main/webapp
</warSourceDirectory>
<warSourceExcludes>
WEB-INF/*.tld,WEB-INF/classes/**
</warSourceExcludes>
<outputDirectory>
${env.WAR_PATH}
</outputDirectory>
<archive>
<manifest>
<addClasspath>false</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
<addMavenDescriptor>true</addMavenDescriptor>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
My way using system's maven (not eclipse's internal maven):
Right-Click to the project -> Preferences -> Builders
New ... -> Program
Set C:\Program Files\apache-maven-3.3.9\bin\mvn.cmd (your directory may be different) to Location.
Set the folder where you have your pom.xml in to "Working Directory:"
Set war:war to Arguments:.
Switch to panel "Build Options" and check "During auto builds".
Now, if you ever change a file (and save) the mvn war:war is executed.
Related
I'm using an older version of eclipse 2018-09 with 32-bit Java, not sure that makes a difference. (project limitation for using these older versions)
I have been using the default maven plugin with the project and it all has worked so far, except for the following one:
<!-- https://mvnrepository.com/artifact/com.github.kilianB/JImageHash -->
<dependency>
<groupId>com.github.kilianB</groupId>
<artifactId>JImageHash</artifactId>
<version>3.0.0</version>
</dependency>
https://mvnrepository.com/artifact/com.github.kilianB/JImageHash/3.0.0
I get:
Missing artifact com.github.kilianB:JImageHash:jar:3.0.0
I have done all the maven things, clean, install, etc...
This jar is located at "JCenter repository (https://jcenter.bintray.com/)".
And the url and files are all there.
https://bintray.com/kilianb/maven/JImageHash/3.0.0#files/com%2Fgithub%2FkilianB%2FJImageHash%2F3.0.0
I even downloaded the files and jars.
I have no settings.xml in my .m2, as I'm using the default eclipse maven. The pom.xml is the default one and I added the dependencies I have needed.
What's missing?
Thanks in advance.
FWIW here's my pom I'm using
<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>patmangames</groupId>
<artifactId>carddetect</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>resources</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/net.sourceforge.tess4j/tess4j -->
<dependency>
<groupId>net.sourceforge.tess4j</groupId>
<artifactId>tess4j</artifactId>
<version>4.5.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.13.1</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.openpnp</groupId>
<artifactId>opencv</artifactId>
<version>4.3.0-1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.11.0</version>
</dependency>
<!-- FAILS TO FIND AND DOWNLOAD-->
<dependency>
<groupId>com.github.kilianB</groupId>
<artifactId>JImageHash</artifactId>
<version>3.0.0</version>
</dependency>
<!-- FAILS TO FIND AND DOWNLOAD-->
</dependencies>
</project>
Without a settings.xml you only get jars from MavenCentral.
Note that MavenCentral has nothing to do with mvnrepository. Finding a jar on mvnrepository does not mean that it is in MavenCentral.
Indeed, in your case, the jar is in jcenter, so you need to write a settings.xml where you add that repository as <repository>.
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.
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>
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.
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.