在maven-surefire-plugin中附加argLine param的值

我正在使用maven-surefire-plugin + Sonar ,我想为maven- argLine -plugin的argLine参数添加一些额外的值。

所以我做到了:

    org.apache.maven.plugins maven-surefire-plugin 2.20.1  -DCRR.Webservice.isSimulated=true -D...   ...   

但在这种情况下,我覆盖了argLine参数的原始值,Sonar不会生成jacoco.exec文件。

我可以在maven调试日志(-X)中看到argLine param的值没有覆盖它的值是-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

APPEND这个参数的原始值的正确方法是什么(保持原始+添加额外的值)?

我使用的是Apache Maven 3.5.0,Java版本:1.8.0_131,供应商:Oracle Corporation。

官方文件称最近更换 。

如果你执行以下操作,你将覆盖之前由另一个插件设置的argLine参数的值,所以不argLine

  org.apache.maven.plugins maven-surefire-plugin  -D... -D...   

保留现有值并添加配置的正确方法是使用@{...}语法:

  org.apache.maven.plugins maven-surefire-plugin  @{argLine} -D... -D...   

或者您可以将argLine设置为pom.xml文件中的property

  -DCRR.Webservice.isSimulated=true -D...  

上述两种解决方案均可正