如何在开始测试之前运行雄猫



经过两天的搜索,我仍然无法在测试前运行雄猫,谁能说出我做得不对吗? 这是我的诗

 <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-failsafe-plugin</artifactId>
    <version>2.16</version>
    <executions>
    <execution>
        <id>integration-test</id>
        <goals>
            <goal>integration-test</goal>
        </goals>
    </execution>
    <execution>
        <id>verify</id>
        <goals>
            <goal>verify</goal>
        </goals>
    </execution>
    </executions>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
    <server>tomcat-development-server</server>
    <port>8081</port>
    <path>/test</path>
</configuration>
<executions>
    <execution>
        <id>start-tomcat</id>
        <phase>pre-integration-test</phase>
        <goals>
            <goal>run</goal>
        </goals>
    </execution>
    <execution>
        <id>stop-tomcat</id>
        <phase>post-integration-test</phase>
        <goals>
            <goal>shutdown</goal>
        </goals>
    </execution>
</executions>

当我使用 mvn 验证我的测试开始时,但服务器没有,我不知道我错过了什么!

我通过在预集成测试阶段添加此代码来解决问题

<configuration>
        <fork>true</fork>
</configuration>

最新更新