【发布时间】:2015-09-09 13:06:16
【问题描述】:
我已将故障安全与 tomcat7-maven-plugin 一起配置为进行集成测试。当我输入时,它很棒并且效果很好:
mvn clean verify -P integration-test
我的pom.xml是这样的:
<!-- Runs integration tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18</version>
<executions>
<!-- Invokes both the integration-test and the verify goals of the Failsafe Maven plugin -->
<execution>
<id>integration-tests</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<!-- Skips integration tests if the value of skip.integration.tests property is true -->
<skipTests>${skip.integration.tests}</skipTests>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<path>/onde-vou</path>
</configuration>
<executions>
<execution>
<id>start-tomcat</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</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>
但是我遇到了意外的行为。当我输入时:
mvn clean install
它启动tomcat并在进程结束时关闭。 我该如何避免这种行为?这对我没用,我会失去一些秒。
【问题讨论】:
标签: java maven-3 maven-failsafe-plugin tomcat7-maven-plugin