Issue
I want to run JaCoCo from the command line on a Maven project without including JaCoCo configuration into the pom.xml.
How do I configure and invoke JaCoCo from the command line like:
$ mvn test <JaCoCo - config params>
In essence, I am looking to get a coverage report for a Maven project without having to manually edit its pom.xml. Invoking JaCoCo directly on the Maven project (without invoking the mvn
command would work to.
Solution
You can use:
mvn clean org.jacoco:jacoco-maven-plugin:0.8.8:prepare-agent verify org.jacoco:jacoco-maven-plugin:0.8.8:report
to call jacoco generation directly from command line without any change in your pom file.
You can replace verify
by test
Answered By - khmarbaise
Answer Checked By - David Goodson (JavaFixing Volunteer)