我最近开始使用maven。所以这个问题听起来很基本。 当我使用cargo插件浏览一些代码时,出现了这个问题。我如何知道maven中插件的不同目标是什么?
在pom.xml中maven插件的下列片段,我提取从here, 我的理解如下:构建
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
<configuration>
[Cargo plugin configuration goes in here]
</configuration>
</plugin>
该插件在绑定到
pre-integration-test
和post-integration-test
相生命周期,这也意味着当我运行mvn install
这将被执行。的目标,这个插件(启动和停止),这些阶段分别
Q1 ::是否
<id>start-container</id>
有任何关联期间被执行?它的目的是什么&重要性?Q2 ::我怎么知道插件可用的不同目标是什么。在这种情况下,对于
cargo plug-in
,我在我的工作中的一个代码中看到,使用了<goal>redeploy</goal>
。所以我想知道如何找到有关这些特定目标和其他可用目标的信息。我确实看过在线文档。我没有找到任何。可能我没有在正确的地方搜索。
你的意思是说文档,maven3比maven2好?我使用'glassFish JavaEE 7教程'中的代码,它显然使用'cargo-maven2-plugin' – 2014-10-03 22:26:29
我的意思是说,maven现在显示了目标。在maven2中,如果你指定了错误的目标,maven只会报告类似于“出错,但不知道是什么”的错误。一般来说,Maven3在报告错误方面要好得多。 – Augusto 2014-10-03 22:30:29