首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何将Maven WAR项目部署到Cargo-Tomcat容器?

如何将Maven WAR项目部署到Cargo-Tomcat容器?
EN

Stack Overflow用户
提问于 2011-10-25 04:07:57
回答 1查看 1.8K关注 0票数 1

我正在使用Maven 3.0.3和Maven-Cargo插件1.1.3以及Tomcat 6.0.33。如何使用Maven-Cargo将现有的WAR项目部署到已安装的Tomcat容器?我有这样的配置...

代码语言:javascript
复制
        <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>

但是当我跑的时候

代码语言:javascript
复制
mvn cargo:start clean install -DCATALINA_HOME=$CATALINA_HOME

WAR文件并没有部署到我已经在运行的Tomcat实例中(当我的集成测试在Tomcat服务器上运行时,我会得到404)。

谢谢你的帮助,-戴夫

EN

回答 1

Stack Overflow用户

发布于 2011-10-25 04:29:36

我正在使用Maven Tomcat插件在运行的Tomcat实例上部署web应用程序。mvn tomcat:部署..也许这对你也是有效的?更多详细信息请访问plugin's website

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7881328

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档