简体   繁体   English

Cargo-Maven2-Plugin没有找到Tomcat / lib目录

[英]Cargo-Maven2-Plugin not finding Tomcat /lib directory

I'm trying to setup Maven to start Tomcat (using Cargo) and deploy my project in preparation for integration tests. 我正在尝试设置Maven来启动Tomcat(使用Cargo)并部署我的项目以准备集成测试。

Here is my POM: 这是我的POM:

< ... >
<plugin>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven2-plugin</artifactId>
    <version>1.1.3</version>
    <configuration>
        <container>
            <containerId>tomcat6x</containerId>
            <type>installed</type>
            <home>/Dev/apache-tomcat-6.0.29/</home>
        </container>
        <configuration>
            <type>existing</type>
            <home>/Dev/apache-tomcat-6.0.29/</home>
        </configuration>
    </configuration>
    <executions>
        <execution>
            <id>start</id>
            <phase>pre-integration-test</phase>
            <goals>
                <goal>start</goal>
            </goals>
        </execution>
        <execution>
            <id>stop</id>
            <phase>post-integration-test</phase>
            <goals>
                <goal>stop</goal>
            </goals>
        </execution>
    </executions>
</plugin>
< .... >

When I clean and build, it can't find Catalina.jar which is in my Tomcat /lib directory: 当我清理和构建时,它找不到位于我的Tomcat / lib目录中的Catalina.jar:

[talledLocalContainer] java.lang.ClassNotFoundException: org.apache.catalina.startup.Catalina
[talledLocalContainer]  at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
[talledLocalContainer]  at java.security.AccessController.doPrivileged(Native Method)
[talledLocalContainer]  at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
[talledLocalContainer]  at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
[talledLocalContainer]  at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
[talledLocalContainer]  at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:216)
[talledLocalContainer]  at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:391)

When running clean and build with debug enabled, it shows that it is looking for Catalina.jar in tomcat/server/lib: 在运行clean并使用debug启用构建时,它显示它正在tomcat / server / lib中查找Catalina.jar:

[talledLocalContainer] Failed to find Tomcat version, base error [\Dev\apache-tomcat-6.0.29\server\lib\catalina.jar (The system cannot find the path specified)]
[talledLocalContainer] Parsed Tomcat version = [6.x]
[talledLocalContainer] Tomcat 6.x starting...
[talledLocalContainer] Project base dir set to:  C:\Users\Colin\Documents\NetBeansProjects\HousingWeb
[talledLocalContainer] Executing 'C:\Program Files\Java\jdk1.6.0_22\jre\bin\java.exe' with arguments:

My tomcat directory looks like this: 我的tomcat目录如下所示:

- apache-tomcat-6.0.29
   + bin
   + conf
   - lib
       - Catalina.jar
       - [bunch of other .jars]
   + logs
   + temp
   + webapps
   + work
   - [other files]

Why might Cargo be looking for Tomcat's lib folder under /server/lib instead of just /lib? 为什么Cargo会在/ server / lib下寻找Tomcat的lib文件夹而不仅仅是/ lib?

Is there a way to override this behavior? 有没有办法覆盖这种行为?

UPDATE: 更新:

After looking through the different versions of Tomcat (5.5, 6.0, 7.0) it looks like the directory structure for 5.5 had /server/lib and /common/lib where 6.0 and 7.0 just have /lib. 查看不同版本的Tomcat(5.5,6.0,7.0)后,看起来5.5的目录结构有/ server / lib和/ common / lib,其中6.0和7.0只有/ lib。

Cargo seems to be trying to instantiate a Tomcat 5.5 app. Cargo似乎试图实例化一个Tomcat 5.5应用程序。 How do I configure it to use 6.0? 如何配置它以使用6.0?

Do you have the same problem if you download and unzip the Tomcat instead of using yours? 如果你下载并解压缩Tomcat而不是使用你的Tomcat,你会遇到同样的问题吗?

<container>
    <containerId>tomcat6x</containerId>
    <zipUrlInstaller>
        <url>http://www.apache.org/dist/tomcat/tomcat-6/v6.0.35/bin/apache-tomcat-6.0.35.zip</url>
    </zipUrlInstaller>
</container>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何指定core.cargo.version在cargo-maven2-plugin中使用 - How to specify core.cargo.version to use in cargo-maven2-plugin 与cargo-maven2-plugin进行的集成测试在停止期间会发生内存泄漏 - integration test with cargo-maven2-plugin have memory leak during the stop 未能在项目 duke 辅导上执行目标 org.codehaus.cargo:cargo-maven2-plugin:1.4.4:redeploy (deploy) - Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.4:redeploy (deploy) on project duke tutoring 由maven部署JavaEE 8教程失败,无法在项目hello1上执行目标org.codehaus.cargo:cargo-maven2-plugin:1.6.4:redeploy(deploy) - Deploying the JavaEE 8 Tutorial, by maven gets Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.6.4:redeploy (deploy) on project hello1 如何正确设置 tomcat 日志到 Maven Cargo Plugin - How properly to set up tomcat logs into Maven Cargo Plugin 使用摘要身份验证将Maven Cargo插件部署到tomcat - Maven Cargo plugin deploying to tomcat using digest authentication Maven将Tomcat JAR复制到webapp WEB-INF / lib目录 - Maven copying Tomcat JARs into webapp WEB-INF/lib directory 如何将文件夹添加到由Maven cargo插件启动的Tomcat容器的类路径中 - How do I add a folder to the classpath of a Tomcat container being started by the maven cargo plugin maven-cargo2-plugin 如何识别我的 Spring 引导应用程序已经有嵌入式 Tomcat 正在运行? - How can maven-cargo2-plugin recognize that my Spring Boot application already has an embedded Tomcat running? Tomcat无法使用货运Maven启动组件 - Tomcat Failed to start component using cargo maven
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM