我在试着安装maven货插件。我有以下要求:
部署到tomcat的自定义server.xml
F 215
我跟踪了以下内容:http://www.java-tutorial.ch/maven/maven-tomcat-deployment-using-cargo。这不是我想要的完整的特性集,甚至它也不能完全工作。我得到的是:
Can't load log handler "4host-manager.org.apache.juli.FileHandler"
[INFO] [talledLocalContainer] java.lang.ClassNotFoundException: 4host-manager.org.apache.juli.FileHandler然后当mvn安装返回时,我执行ps -ef,并且没有tomcat进程。
此外,它还将war复制到ROOT.war,但是旧的根目录没有被替换,因此新的ROOT.war实际上不会被部署。
对于“安装tomcat (如果还没有安装)”的要求,这看起来应该是非常简单的,但是当我提供
<zipUrlInstaller>
<url>http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip</url>
<extractDir>/usr/local</extractDir>
</zipUrlInstaller>然后运行mvn cargo:install,它会抛出以下内容:
org.codehaus.cargo.container.ContainerException: Failed to get container installation home as the container has not yet been installed. Please call install() first.真是令人费解。它希望我先调用install,但我正在调用install。
想法?
发布于 2011-06-28 04:14:08
您所遵循的链接给出了货物1.0.6的演示。最近可用的版本为1.1.1,因此我建议您使用最近的,并且在子标记中有某些更改
正如在post http://cargo.codehaus.org/Deploying+to+a+running+container中所描述的。ZipUrlInstaller的子标记中有ceratin的变化。
<!--
Careful: As described in the ZipUrlInstaller documentation,
Cargo versions older than 1.1.0 accept only installDir, you therefore
need to set installDir instead of downloadDir and extractDir.
-->尝试使用maven原型在post http://cargo.codehaus.org/Maven2+Archetypes之后创建cargo示例项目。我建议你使用“单一Webapp模块原型”
在设置maven项目之后,您可以安装运行mvn : install -P tomcat6x命令的tomcat 6。
pom.xml片段的“单一的webapp模块原型”,这可能是有用的。
<profiles>
<profile>
<id>tomcat6x</id>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<wait>true</wait>
<container>
<containerId>tomcat6x</containerId>
<!-- download zip url -->
<zipUrlInstaller>
<url>http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.zip</url>
<downloadDir>${project.build.directory}/downloads</downloadDir>
<extractDir>${project.build.directory}/extracts</extractDir>
</zipUrlInstaller>
</container>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>where参数true将为您提供检查服务器是否正在运行的选项。
https://stackoverflow.com/questions/6447252
复制相似问题