JaCoCo not generating jacoco.exec until after skipping JaCoCo execution

后端 未结 6 1234
执念已碎
执念已碎 2021-02-19 00:27

I\'m having trouble generating AHP reports via JaCoCo in one of my modules. When the build starts, I see JaCoCo correctly setting argLine with:

[INFO] jacoco.age         


        
6条回答
  •  天命终不由人
    2021-02-19 01:01

    To solve this issue I would use the following three steps:

    1. Determine which plugin execution is producing the jacoco.exec file. To do that, you could run Maven with debug logging enabled (mvn -X) and look for the jacoco.agent.argLine property name or its value in the output. You could also have a look at the effective POM (mvn help:effective-pom) in case the relevant configuration comes from the parent POM. Note that my guess is that it's an execution of the maven-failsafe-plugin.

    2. Determine the phase that plugin is executed in. E.g. for maven-failsafe-plugin this would likely be integration-test.

    3. Change the configuration of the JaCoCo plugin so that the report goal is executed later in the build lifecycle. E.g. if the jacoco.exec file is produced in the integration-test phase, you could execute the report goal in the post-integration-test phase.

提交回复
热议问题