gpt4 book ai didi

java - maven - 无法执行 cargo :start

转载 作者:行者123 更新时间:2023-11-29 07:55:28 26 4
gpt4 key购买 nike

我正在尝试在我的 servlet 项目中配置 cargo 自动部署,我在 pom.xml 文件中有这些:

    <dependency>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-core-api-module</artifactId>
<version>1.4.3</version>
</dependency>
<!--
<dependency>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-core-container-tomcat</artifactId>
<version>1.4.2-SNAPSHOT</version>
</dependency>
-->
<dependency>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.2</version>
</dependency>
<build>
<plugins>
<!-- cargo plugin -->
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<container>
<containerId>tomcat6x</containerId>
<type>remote</type>
<systemProperties>
<cargo.jvmargs>-XX:MaxPermSize=256M -Xmx1024m</cargo.jvmargs>
</systemProperties>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.hostname>${remote.hostname}</cargo.hostname>
<cargo.protocol>${remote.protocol}</cargo.protocol>
<cargo.servlet.port>9000</cargo.servlet.port>
<cargo.tomcat.manager.url>http://localhost:9000/manager</cargo.tomcat.manager.url>
<cargo.remote.username>user</cargo.remote.username>
<cargo.remote.password>pass</cargo.remote.password>
</properties>
</configuration>
<deployer>
<type>remote</type>
<deployables>
<deployable>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<type>war</type>
<properties>
<context>latest</context>
</properties>
</deployable>
</deployables>
</deployer>
</configuration>
</plugin>
<!-- End cargo plugin -->
</plugins>
<build>>

当我尝试通过 mvn clean cargo:start 启动 cargo 时,我得到构建失败:

[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.3:start (default-cli) on project my-app: Unable to parse configuration of mojo org.codehaus.cargo:cargo-maven2-plugin:1.4.3:start for parameter deployables: Cannot find 'deployables' in class org.codehaus.cargo.maven2.configuration.Deployer -> [Help 1]

有什么想法吗?谢谢。

最佳答案

根据documentation “deployer”元素不能包含“deployables”子元素。为了使事情正常进行,您应该将“deployables”放在“configuration”元素下

<configuration>
<container>
[...]
</container>
<configuration>
<type>standalone</type>
[...]
</configuration>
<deployables>
<deployable>
<groupId>my.war.groupId</groupId>
<artifactId>my-war</artifactId>
<type>war</type>
</deployable>
</deployables>
</configuration>

关于java - maven - 无法执行 cargo :start,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18061318/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com