在不破坏集成测试执行的情况下将war部署到远程tomcat服务器

时间:2015-02-13 21:49:41

标签: java maven tomcat maven-plugin maven-tomcat-plugin

我使用tomcat7-maven-plugin使用mvn verify命令在我的localhost Tomcat上运行集成测试。但是,当我运行mvn tomcat7:redeploy时,我想将war部署到我的远程tomcat服务器而不是localhost tomcat。我怎样才能做到这一点?请指导。

的pom.xml

  <!-- Embedded integration testing with localhost Tomcat -->
    <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.2</version>
        <executions>
            <execution>
                <id>start-tomcat</id>
                <phase>pre-integration-test</phase>
                <goals>
                    <goal>run-war</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>

    <!-- Integration tests -->
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.18</version>
        <executions>
            <execution>
                <goals>
                    <goal>integration-test</goal>
                    <goal>verify</goal>
                </goals>
            </execution>
        </executions>
    </plugin>

0 个答案:

没有答案