如何指定在cargo-maven2-plugin中使用的core.cargo.version
我正在尝试升级现有的 Maven 应用程序以使用 tomcat 7.10 及更高版本。
在 7.8 上,我使用 Cargo-maven2-plugin 来启动 tomcat 容器并部署 web 应用程序,这工作得很好。
在 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
这是由于该库在 7.9 中已从 tomcat 中删除,但我使用的货物版本仍在其 server.xml 配置中指定了该库。
该错误已在 Cargo 1.1.0 中修复(http://jira.codehaus.org/browse/CARGO-923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel )
我正在尝试弄清楚如何强制使用 maven (或更具体地说cargo-maven2-plugin )应该使用的货物版本。
我的 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>
问题是,这将始终通过cargo-maven2-plugin版本号使用cargo 1.6。如果我检查 mvnrepository 这是可用的最新版本(并且已损坏)。
如果我尝试在配置->属性部分中指定 core.cargo.version ,它似乎没有任何区别。
有什么想法吗?
I am trying to upgrade my existing maven application to use tomcat 7.10 and above.
On 7.8 I use the cargo-maven2-plugin to startup the tomcat container and deploy the webapp, this works fine.
On 7.10 and above this fails with the error:
[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.
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 )
I am trying to work out how to force the version of cargo that maven ( or more specifically cargo-maven2-plugin ) should be using.
The relevant part of my pom.xml looks like this:
<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. If I check mvnrepository this is is the latest version that is available ( and is broken ).
If I try to specify core.cargo.version in the configuration->properties section it doesn't seem to make any difference.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道这张票已经很旧了,但答案对于其他愿意打开它的人来说可能很有用。
您可以直接在 pom.xml 的插件定义中指定依赖项,从而覆盖插件依赖项的版本,如以下示例所示。
cargo-maven2-plugin
的版本是1.4.10
,我覆盖了一些依赖项的版本以使用1.4.11
。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. The version of the
cargo-maven2-plugin
is1.4.10
and I override the version of the some dependencies to use the1.4.11
instead.