Java 如何在开始测试之前运行tomcat

Java 如何在开始测试之前运行tomcat,java,continuous-integration,tomcat7,pom.xml,Java,Continuous Integration,Tomcat7,Pom.xml,经过两天的搜索,我仍然无法在测试前运行tomcat,有人能告诉我什么地方做得不对吗?这是我的pom <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <version>2.16</version> <executions>

经过两天的搜索,我仍然无法在测试前运行tomcat,有人能告诉我什么地方做得不对吗?这是我的pom

 <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>

org.apache.maven.plugins
maven故障保护插件
2.16
集成测试
集成测试
验证
验证
org.apache.tomcat.maven
tomcat7 maven插件
2.2
tomcat开发服务器
8081
/试验
启动雄猫
预集成测试
跑
阻止雄猫
整合后测试
关闭

当我使用mvn验证我的测试启动时,但服务器没有启动,我不知道我缺少了什么

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

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

真的

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

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

真的