Last active
December 10, 2015 05:19
-
-
Save isopov/4387142 to your computer and use it in GitHub Desktop.
Full example for stackoverflow question - http://stackoverflow.com/questions/14052694/how-do-i-include-test-classes-and-configuration-in-my-war-for-integration-testin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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.sopovs.moradanen</groupId> | |
<artifactId>war-it-test</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<packaging>war</packaging> | |
<dependencies> | |
<dependency> | |
<groupId>javax.servlet</groupId> | |
<artifactId>javax.servlet-api</artifactId> | |
<version>3.0.1</version> | |
<scope>provided</scope> | |
</dependency> | |
</dependencies> | |
<build> | |
<finalName>war-it-test</finalName> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<version>3.0</version> | |
<configuration> | |
<source>1.7</source> | |
<target>1.7</target> | |
</configuration> | |
</plugin> | |
</plugins> | |
</build> | |
<profiles> | |
<profile> | |
<id>integration</id> | |
<build> | |
<finalName>war-it-test-integration</finalName> | |
<plugins> | |
<plugin> | |
<artifactId>maven-antrun-plugin</artifactId> | |
<version>1.7</version> | |
<executions> | |
<execution> | |
<phase>process-test-classes</phase> | |
<configuration> | |
<target> | |
<copy todir="${basedir}/target/classes"> | |
<fileset dir="${basedir}/target/test-classes" includes="**/*" /> | |
</copy> | |
</target> | |
</configuration> | |
<goals> | |
<goal>run</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> | |
</plugins> | |
</build> | |
</profile> | |
</profiles> | |
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>org.codehaus.mojo</groupId> | |
<artifactId>build-helper-maven-plugin</artifactId> | |
<version>1.7</version> | |
<executions> | |
<execution> | |
<id>add-test-source</id> | |
<phase>generate-sources</phase> | |
<goals> | |
<goal>add-source</goal> | |
</goals> | |
<configuration> | |
<sources> | |
<source>${basedir}/src/test/java</source> | |
</sources> | |
</configuration> | |
</execution> | |
<execution> | |
<id>add-test-resource</id> | |
<phase>generate-sources</phase> | |
<goals> | |
<goal>add-resource</goal> | |
</goals> | |
<configuration> | |
<resources> | |
<resource> | |
<directory>${basedir}/src/test/resources</directory> | |
</resource> | |
</resources> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment