【发布时间】:2015-07-13 08:20:13
【问题描述】:
我正在尝试通过货物运行 tomcat。 Tomcat 已经安装。 cargo:deploy 工作正常,但是当我尝试 cargo:run 时出现以下错误
If you specify a containerId, you also need to specify a containerUrl.
如果我指定一个 containerURL,我会收到以下错误
[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-
plugin:1.4.13:run (default-cli) on project ctm: Unable to parse configuration
of mojo org.codehaus.cargo:cargo-maven2-plugin:1.4.13:run for parameter
containerURL: Cannot find 'containerURL' in class org.codehaus.cargo.maven2.configuration.Container
...
这是我的 Maven 配置
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.4.13</version>
<configuration>
<container>
<type>existing</type>
<containerId>${cargo.maven.containerId}</containerId>
<home>${container.home}</home>
</container>
<configuration>
<type>existing</type>
<home>${container.home}</home>
</configuration>
<deployables>
<deployable>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<type>war</type>
<properties>
<context>example</context>
</properties>
</deployable>
</deployables>
</configuration>
<executions>
<execution>
<id>run</id>
<configuration>
<configuration>
<type>existing</type>
</configuration>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
这是我的个人资料
<profile>
<id>developer-properties</id>
<properties>
<cargo.maven.containerId>tomcat7x</cargo.maven.containerId>
<container.home>C:/apache-tomcat-7.0.35</container.home>
</properties>
</profile>
根据货物文件;类型“existing”应该使用现有的容器安装。除非类型是“独立”,否则我认为不需要 containerURL。我不明白为什么会收到 containerURL 错误。
关于类型的文档在这里:https://codehaus-cargo.github.io/cargo/Existing+Local+Configuration.html
【问题讨论】:
-
我认为
Cannot find 'containerURL'的问题只是区分大小写的问题,试试containerUrl -
我仍然收到与 containerUrl 相同的错误
标签: maven tomcat tomcat7 maven-3 cargo