I am attempting to run integration tests on an embedded tomcat instance in a multi-module maven project. I am using the tomcat7-maven-plugin configured as follows:
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<server>my-tomcat</server>
<path>/svc</path>
<url>http://localhost:8080/manager/text</url>
</configuration>
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.cenqua.clover</groupId>
<artifactId>clover</artifactId>
<version>3.2.0</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<executions>
<execution>
<id>start-tomcat</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run-war-only</goal>
</goals>
<configuration>
<fork>true</fork>
</configuration>
</execution>
<execution>
<id>stop-tomcat</id>
<phase>post-integration-test</phase>
<goals>
<goal>shutdown</goal>
</goals>
</execution>
</executions>
</plugin>
But it appears that the server does not shutdown. It will either fail on the next clean or if I set my context's antiResourceLocking to true I can see that the next time run-war-only is called I get a binding error due to the port already being in use by the previous orphaned tomcat process. Everything runs fine outside of bamboo. What do I have to configure to make this work as it should? I am using bamboo version 5.2.2 build 4010. Thanks.