我将 Maven 3.0.3 与 Maven-Cargo 插件 1.1.3 与 Tomcat 6.0.33 一起使用。如何使用 Maven-Cargo 将现有的 WAR 项目部署到已安装的 Tomcat 容器中?我有这个配置...
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<wait>false</wait>
<container>
<containerId>tomcat6x</containerId>
<type>installed</type>
<!-- The home folder for your local Tomcat -->
<home>${CATALINA_HOME}</home>
</container>
<configuration>
<type>existing</type>
<home>${CATALINA_HOME}</home>
</configuration>
<deployer>
<!-- You have to again specify that the type for the deployer -->
<type>local</type>
<deployables>
<!-- This deployable specifies the webapp you want to deploy -->
<deployable>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<type>${project.packaging}</type>
</deployable>
</deployables>
</deployer>
</configuration>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
但是当我跑步时
mvn cargo:start clean install -DCATALINA_HOME=$CATALINA_HOME
WAR 文件没有部署到我已经运行的 Tomcat 实例(当我的集成测试针对 Tomcat 服务器运行时,我得到 404)。
感谢您的帮助,-戴夫