Skip to content

Instantly share code, notes, and snippets.

@virgium03
Created September 12, 2013 09:53
Show Gist options
  • Save virgium03/6535197 to your computer and use it in GitHub Desktop.
Save virgium03/6535197 to your computer and use it in GitHub Desktop.
Run integration tests with Tomcat7 using the Maven plug in. Including JNDI data source and context root.
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<fork>true</fork>
<port>8080</port>
<path>...path>
<contextFile>src/test/resources/context.xml</contextFile>
</configuration>
<dependencies>
<dependency>
<groupId>...</groupId>
<artifactId>...</artifactId>
<version>...</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>start-tomcat</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run-war-only</goal>
</goals>
</execution>
<execution>
<id>stop-tomcat</id>
<phase>post-integration-test</phase>
<goals>
<goal>shutdown</goal>
</goals>
</execution>
</executions>
</plugin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment