[英]How to specify core.cargo.version to use in cargo-maven2-plugin
I am trying to upgrade my existing maven application to use tomcat 7.10 and above. 我正在尝试升级现有的Maven应用程序以使用tomcat 7.10及更高版本。
On 7.8 I use the cargo-maven2-plugin to startup the tomcat container and deploy the webapp, this works fine. 在7.8上,我使用cargo-maven2-plugin启动了tomcat容器并部署了webapp,这可以正常工作。
On 7.10 and above this fails with the error: 在7.10及更高版本上,此操作失败并显示以下错误:
[WARNING] [talledLocalContainer] 14/04/2011 12:21:43 PM org.apache.tomcat.util.digester.Digester startElement
[WARNING] [talledLocalContainer] SEVERE: Begin event threw exception
[WARNING] [talledLocalContainer] java.lang.ClassNotFoundException: org.apache.catalina.mbeans.ServerLifecycleListener
This is due to the fact that this library was removed from tomcat in 7.9 but the version of cargo I am using is still specifying this library in it's server.xml config. 这是由于该库已在7.9中从tomcat中删除,但我使用的cargo版本仍在server.xml配置中指定了该库。
The bug was fixed in cargo 1.1.0 ( http://jira.codehaus.org/browse/CARGO-923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ) 该错误已在商品1.1.0中修复( http://jira.codehaus.org/browse/CARGO-923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel )
I am trying to work out how to force the version of cargo that maven ( or more specifically cargo-maven2-plugin ) should be using. 我正在尝试找出如何强制Maven(或更具体地说是cargo-maven2-plugin)应该使用的货物版本。
The relevant part of my pom.xml looks like this: 我的pom.xml的相关部分如下所示:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0.6</version>
<configuration>
<container>
<containerId>tomcat7x</containerId>
<zipUrlInstaller>
<url>http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.12/bin/apache-tomcat-7.0.12.zip</url>
<installDir>${user.home}/java/cargo/</installDir>
</zipUrlInstaller>
</container>
<configuration>
<properties>
<cargo.logging>low</cargo.logging>
<cargo.servlet.port>8280</cargo.servlet.port>
</properties>
</configuration>
</configuration>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
</executions>
</plugin>
The problem is that this will always use cargo 1.6 via the cargo-maven2-plugin version number. 问题在于,这将始终通过cargo-maven2-plugin版本号使用商品1.6。 If I check mvnrepository this is is the latest version that is available ( and is broken ). 如果我检查mvnrepository,则这是可用的最新版本(并且已损坏)。
If I try to specify core.cargo.version in the configuration->properties section it doesn't seem to make any difference. 如果我尝试在configuration-> properties部分中指定core.cargo.version,那么似乎没有什么区别。
Any ideas? 有任何想法吗?
I know that this ticket is old but the answer can be useful for somebody else who would open it. 我知道这张票很旧,但是答案对其他会打开它的人很有用。
You can specify dependencies directly in your plugin definition in the pom.xml and thereby override the version of your plugin's dependencies like in the following sample. 您可以在pom.xml的插件定义中直接指定依赖项,从而像以下示例中那样覆盖插件依赖项的版本。 The version of the cargo-maven2-plugin
is 1.4.10
and I override the version of the some dependencies to use the 1.4.11
instead. cargo-maven2-plugin
的版本是1.4.10
而我重写了某些依赖项的版本以改用1.4.11
。
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.10</version>
<configuration>
<container>
<containerId>tomcat7x</containerId>
</container>
</configuration>
<executions>
<execution>
<id>run</id>
<goals>
<goal>start</goal>
</goals>
<phase>pre-integration-test</phase>
</execution>
<execution>
<id>finish</id>
<goals>
<goal>stop</goal>
</goals>
<phase>post-integration-test</phase>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-core-api-generic</artifactId>
<version>1.4.11</version>
</dependency>
<dependency>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-documentation</artifactId>
<version>1.4.11</version>
</dependency>
<dependency>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-daemon-client</artifactId>
<version>1.4.11</version>
</dependency>
<dependency>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-core-api-container</artifactId>
<type>test-jar</type>
<version>1.4.11</version>
</dependency>
</dependencies>
</plugin>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.