如何指定在cargo-maven2-plugin中使用的core.cargo.version

发布于 2024-11-01 04:27:22 字数 2329 浏览 4 评论 0原文

我正在尝试升级现有的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

自在安然 2024-11-08 04:27:22

我知道这张票已经很旧了,但答案对于其他愿意打开它的人来说可能很有用。

您可以直接在 pom.xml 的插件定义中指定依赖项,从而覆盖插件依赖项的版本,如以下示例所示。 cargo-maven2-plugin 的版本是 1.4.10,我覆盖了一些依赖项的版本以使用 1.4.11

<plugin>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven2-plugin</artifactId>
    <version>1.4.10</version>
    <configuration>
        <container>
            <containerId>tomcat7x</containerId>
        </container>
    </configuration>
    <executions>
        <execution>
            <id>run</id>
            <goals>
                <goal>start</goal>
            </goals>
            <phase>pre-integration-test</phase>
        </execution>
        <execution>
            <id>finish</id>
            <goals>
                <goal>stop</goal>
            </goals>
            <phase>post-integration-test</phase>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-core-api-generic</artifactId>
            <version>1.4.11</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-documentation</artifactId>
            <version>1.4.11</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-daemon-client</artifactId>
            <version>1.4.11</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-core-api-container</artifactId>
            <type>test-jar</type>
            <version>1.4.11</version>
        </dependency>
    </dependencies>
</plugin>

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 is 1.4.10 and I override the version of the some dependencies to use the 1.4.11 instead.

<plugin>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven2-plugin</artifactId>
    <version>1.4.10</version>
    <configuration>
        <container>
            <containerId>tomcat7x</containerId>
        </container>
    </configuration>
    <executions>
        <execution>
            <id>run</id>
            <goals>
                <goal>start</goal>
            </goals>
            <phase>pre-integration-test</phase>
        </execution>
        <execution>
            <id>finish</id>
            <goals>
                <goal>stop</goal>
            </goals>
            <phase>post-integration-test</phase>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-core-api-generic</artifactId>
            <version>1.4.11</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-documentation</artifactId>
            <version>1.4.11</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-daemon-client</artifactId>
            <version>1.4.11</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-core-api-container</artifactId>
            <type>test-jar</type>
            <version>1.4.11</version>
        </dependency>
    </dependencies>
</plugin>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文