【发布时间】:2013-03-23 10:11:32
【问题描述】:
我正在尝试使用 mvn tomcat:deploy 将单个战争项目部署到多个 tomcat。由于这些是侦听器项目(又名工人),因此它们的重叠名称是无关紧要的。
当我有
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<url>`http://192.168.116.54:8080/`manager/text</url>
<server>standaardTomcat</server>
<path>/picalcworker</path>
</configuration>
</plugin>
将在该服务器上部署一场战争。虽然我不能拥有同一个 groupId artifactId 组合的多个“插件”,所以只需复制它并更改 url 将导致警告并且只有一个(最新的)要部署。
这个插件似乎进一步允许:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>1</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
<configuration>
<url>http://192.168.116.52:8080/manager/text</url>
<server>standaardTomcat</server>
<path>/picalcworker</path>
</configuration>
</execution>
<execution>
<id>2</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
<configuration>
<url>http://192.168.116.53:8080/manager/text</url>
<server>standaardTomcat</server>
<path>/picalcworker</path>
</configuration>
</execution>
</executions>
</plugin>
但随后mvn tomcat:deploy 将尝试部署到localhost,因为<configuration><url> 在此插件的根目录中为空(但我无法在此处提供单个网址,因为我需要多个网址)。也可以是tomcat7 和tomcat6。
我真的很喜欢部署和取消部署选项。有谁知道如何使这项工作,或一些合理的替代方案?
【问题讨论】:
标签: maven tomcat deployment war maven-tomcat-plugin