簡體   English   中英

Cargo-Maven2-Plugin沒有找到Tomcat / lib目錄

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

我正在嘗試設置Maven來啟動Tomcat(使用Cargo)並部署我的項目以准備集成測試。

這是我的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>
< .... >

當我清理和構建時,它找不到位於我的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)

在運行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:

我的tomcat目錄如下所示:

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

為什么Cargo會在/ server / lib下尋找Tomcat的lib文件夾而不僅僅是/ lib?

有沒有辦法覆蓋這種行為?

更新:

查看不同版本的Tomcat(5.5,6.0,7.0)后,看起來5.5的目錄結構有/ server / lib和/ common / lib,其中6.0和7.0只有/ lib。

Cargo似乎試圖實例化一個Tomcat 5.5應用程序。 如何配置它以使用6.0?

如果你下載並解壓縮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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM