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

前端 未结 10 536
深忆病人
深忆病人 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:14

    Since the jacoco-maven-plugin:prepare-agent goal executes before the maven-surefire-plugin, try adding the ${argLine} variable into the argLine value set by the maven-surefire-plugin.

    Example:

    
      maven-surefire-plugin
      2.12.1
      
        -server -ea -XX:MaxPermSize=256m -Xmx4g -XX:-UseSplitVerifier ${argLine}
      
    
    

    I had the same problem and this solution worked for me, without any need to reconfigure other sections of the POM.

提交回复
热议问题