我試圖將一個虛擬機參數傳遞給Maven,特別是一套由失敗保護運行的測試。虛擬機參數與maven-failsafe插件
我的pom.xml看起來是這樣的:
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<argLine>-Dtest.data=true</argLine>
</configuration>
<version>2.7.2</version>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
<execution>
<id>verify</id>
<goals>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
...
當我運行依賴於test.data命令mvn clean verify
測試被設置爲true失敗了。但是,當我運行命令mvn -Dtest.data=true clean verify
時,測試全部通過。我需要在我的CI環境中爲pom設置參數。
我失去了一些東西在這裏?
由於提前,
皮特
第一個建議是更新到Maven-FailSafe-Plugin 2.8。你是否要求JVM? – khmarbaise 2011-04-06 16:25:45
我已更新到2.8,仍然無法正常工作。我如何知道我是否分叉JVM?我不相信我。 – Caps 2011-04-07 09:28:00
默認說你是分叉的。 – khmarbaise 2011-04-07 12:08:34