【发布时间】:2014-07-26 18:11:44
【问题描述】:
我正在由 Jenkins 使用 maven 构建战争文件,我需要同时将其部署到 2 个正在运行的 tomcat 上。我在 pom.xml 中写了两个配置文件(每个 tomcat),但是当我运行时
cargo:deploy -Pprofile1,profile2
它仅部署到 profile2。所以我需要运行命令 2 次:
cargo:deploy -Pprofile1
cargo:deploy -Pprofile2
这就是我的 pom.xml 的样子:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.8</version>
<configuration>
<container>
<containerId>tomcat7x</containerId>
<type>remote</type>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.remote.uri>${cargo.manager.url}</cargo.remote.uri>
<cargo.remote.username>${cargo.username}</cargo.remote.username>
<cargo.remote.password>${cargo.password}</cargo.remote.password>
</properties>
</configuration>
<deployables>
<deployable>
<groupId>com.softserveinc</groupId>
<artifactId>oms</artifactId>
<!-- <version>1.0.0-BUILD-SNAPSHOT</version> -->
<type>war</type>
</deployable>
</deployables>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>profile1</id>
<properties>
<cargo.manager.url>http://<here shuold be ip addres>/manager/text</cargo.manager.url>
<cargo.username>admin</cargo.username>
<cargo.password>admin</cargo.password>
</properties>
</profile>
<profile>
<id>profile2</id>
<properties>
<cargo.manager.url>http://<here shuold be ip addres>/manager/text</cargo.manager.url>
<cargo.username>admin</cargo.username>
<cargo.password>admin</cargo.password>
</properties>
</profile>
</profiles>
但我需要通过 1 个命令为 2 个 tomcat 执行此操作吗?有人知道怎么做吗?
【问题讨论】:
标签: maven tomcat jenkins cargo