Cannot use jacoco JVM args and surefire JVM args together in maven

前端 未结 10 537
深忆病人
深忆病人 2020-11-30 01:48

I am using maven with the jacoco plugin to generate code coverage metrics. I am having some difficulty in configuring the surefire plugin with the java opt

10条回答
  •  感动是毒
    2020-11-30 02:13

    For me upgrading the version from 0.7.7.201606060606 to 0.7.9 also fixed this.

    I had to explicitly add the version to the commandline (not just to the pom) because the build server kept using the old verison. This can be done as follows:

     org.jacoco:jacoco-maven-plugin:0.7.9:prepare-agent
    

    instead of

    org.jacoco:jacoco-maven-plugin:prepare-agent
    

    The jacoco plugin site (for sonar) states that argline must be added as a property. For me it also worken when using the @{argLine} in the surefire plugin settings.

提交回复
热议问题