【发布时间】:2011-08-05 04:58:25
【问题描述】:
我正在尝试升级我现有的 maven 应用程序以使用 tomcat 7.10 及更高版本。
在 7.8 上我使用 cargo-maven2-plugin 启动 tomcat 容器并部署 webapp,这工作正常。
在 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 这是可用的最新版本(并且已损坏)。
如果我尝试在 configuration->properties 部分指定 core.cargo.version,它似乎没有任何区别。
有什么想法吗?
【问题讨论】:
-
在进一步搜索时,我可以使用此处的说明(cargo.codehaus.org/Maven2+Plugin+Installation)“有点”让这个工作,但这似乎不是解决问题的好方法,因为它使用的是夜间快照而不是发布。
-
为了进一步更新,我使用上述说明使此配置正常工作,一旦值得注意的更改(对于有相同问题的其他人)是确保您放置“
true " 块内的 "plugin->configuration" 块,以便它在启动后不会立即关闭 tomcat。
标签: java maven-3 cargo maven-cargo cargo-maven2-plugin