【发布时间】:2017-09-29 13:05:33
【问题描述】:
我正在同时使用maven-surefire-plugin + Sonar,我想为 maven-surefire-plugin 的 argLine 参数添加一些额外的值。
所以我做到了:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
<configuration>
<argLine>-DCRR.Webservice.isSimulated=true -D...</argLine>
</configuration>
</plugin>
...
</plugins>
</build>
但在这种情况下,我将覆盖 argLine 参数的原始值,Sonar 不会生成 jacoco.exec 文件。
我可以在 maven 调试日志 (-X) 中看到 argLine 参数的值而不覆盖其值是 -javaagent:/opt/jenkins/.../myproject-SONAR/.repository/org/jacoco/org.jacoco.agent/0.7.4.201502262128/org.jacoco.agent-0.7.4.201502262128-runtime.jar=destfile=/opt/jenkins/.../myproject-SONAR/target/jacoco.exec。
附加此参数原始值的正确方法是什么(保留原始值+添加额外值)?
我使用的是 Apache Maven 3.5.0,Java 版本:1.8.0_131,供应商:Oracle Corporation。
【问题讨论】:
标签: java maven maven-3 maven-surefire-plugin