我们使用构建服务器上的Cargo和Maven远程部署WAR文件,从构建服务器到内部QA服务器进行测试。
我们当前项目的POM如下所示,并在热部署中正常工作。
问题是,我们希望货插件停止Tomcat实例,部署新的WAR,然后启动Tomcat,而不是热部署。是否有办法改变POM以管理此场景?
我们的Maven构建被定义为:
mvn clean deploy ... cargo:redeploy以及POM中的货物插件设置:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<container>
<containerId>tomcat7x</containerId>
<type>remote</type>
<systemProperties>
<cargo.jvmargs>-XX:MaxPermSize=256M -Xmx1024m</cargo.jvmargs>
</systemProperties>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.hostname>qa-server</cargo.hostname>
<cargo.servlet.port>8080</cargo.servlet.port>
<cargo.tomcat.manager.url>http://qa-server:8080/manager</cargo.tomcat.manager.url>
<cargo.remote.username>username</cargo.remote.username>
<cargo.remote.password>pass</cargo.remote.password>
</properties>
</configuration>
<deployer>
<type>remote</type>
<deployables>
<deployable>
<groupId>com.ourcompany</groupId>
<artifactId>myapp-artifactId</artifactId>
<type>war</type>
<properties>
<context>latest</context>
</properties>
</deployable>
</deployables>
</deployer>
</configuration>
</plugin>发布于 2012-03-16 14:50:00
我们在货物方面遇到困难。过了一段时间,tomcat被卡住了,无法重新启动。货物不允许起止。
因此,我们最终所做的是放弃货物,并使用脚本重新启动tomcat,距离我们的jenkins机器很远。此外,我们共享用于部署wars的集成机器上的文件夹。我们还为我们的conf文件和文件夹使用maven程序集插件。
发布于 2012-08-26 10:45:37
如何在cleanTomcat文件中调用build.xml ant任务并遵循以下流程:
#1. stop, clean container, start
mvn cargo:stop
antrun:run <<<<<<< build.xml file to clean +war +warUnpacked +context.xml
cargo:start
#2. deploy your webapp
mvn cargo:deploy关于伊洛多先前的响应,在服务器之间共享文件夹是提高部署阶段快速性的好方法。
您也可以使用maven-洁净插件 (是的,mvn,但具有额外的配置)来清除java项目之外的目录,即删除tomcat容器中需要删除的内容。
https://stackoverflow.com/questions/9739204
复制相似问题