本文介绍了maven - 无法执行货物:启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在我的servlet项目中配置 cargo
自动部署,我在 pom.xml
文件: <依赖关系>
< groupId> org.codehaus.cargo< / groupId>
< artifactId> cargo-core-api-module< / artifactId>
< version> 1.4.3< / version>
< / dependency>
<! -
<依赖关系>
< groupId> org.codehaus.cargo< / groupId>
< artifactId> cargo-core-container-tomcat< / artifactId>
< version> 1.4.2-SNAPSHOT< / version>
< / dependency>
- >
<依赖关系>
< groupId> org.codehaus.cargo< / groupId>
< artifactId> cargo-maven2-plugin< / artifactId>
< version> 1.4.2< / version>
< / dependency>
< build>
< plugins>
<! - 货物插件 - >
< 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>
<属性>
< 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>
<属性>
< context>最新< / context>
< / properties>
< / deployable>
< / deployables>
< / deployer>
< / configuration>
< / plugin>
<! - 结束货物插件 - >
< / plugins>
< build>>
当我尝试通过开始货物mvn清洁货物:开始
我得到BUILD FAILURE:
[ERROR]无法执行目标org.codehaus.cargo:cargo-maven2- plugin:1.4.3:project(default-cli)项目my-app:无法解析mojo org.codehaus.cargo的配置:cargo-maven2-plugin:1.4.3:start for parameters deployables:找不到'deployables'在类org.codehaus.cargo.maven2.configuration.Deployer - > [帮助1]
任何想法? tnx。
解决方案
根据deployer元素不能包含deployables子元素。要使事情发挥作用,您应该将可部署放在配置元素
< 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>
I'm trying to configure cargo
automatic deployment in my servlet project and I have these in pom.xml
file:
<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>>
When I try to start cargo via mvn clean cargo:start
I get BUILD FAILURE:
[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]
any idea? tnx.
解决方案
According to the documentation "deployer" element can not contain "deployables" child element. To make things work you should place "deployables" under "configuration" element
<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>
这篇关于maven - 无法执行货物:启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!