【发布时间】:2016-04-07 02:55:44
【问题描述】:
我正在尝试编写一个 maven profile,它将运行 cargo:run goal 并将启动一个容器并等待用户按 CTRL + C 停止。但是,当我运行mvn clean install -PstartApplication 时,该命令无需等待即可成功完成。我错过了什么?
<profile>
<id>startApplication</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<wait>true</wait>
<container>
<containerId>tomcat7x</containerId>
<type>installed</type>
<home>${catalina.home}</home>
</container>
<configuration>
<type>standalone</type>
<home>${project.basedir}/target/tomcat7x</home>
</configuration>
<deployables>
<deployable>
<properties>
<context>ROOT</context>
</properties>
<groupId>com.demo.web</groupId>
<artifactId>sample-web-app</artifactId>
<type>war</type>
</deployable>
</deployables>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</configuration>
</plugin>
</plugins>
</build>
</profile>
【问题讨论】:
标签: maven maven-2 maven-cargo