Setting dataFile via a user property

149 views
Skip to first unread message

Erran Carey

unread,
Jun 8, 2015, 1:17:47 PM6/8/15
to jac...@googlegroups.com
Question: Is it possible to set the jacoco dataFile property used by jacoco:report using a user property?

Problem I'm trying to solve if there's a different solution:

In one of the projects at work we're unable to find jacoco results with jacoco:report.

The project runs the following maven goals for unit tests "jacoco:prepare-agent", "surefire:test", and "jacoco:report". This fails with the following error:

[java] [INFO] --- jacoco-maven-plugin:0.7.1.201405082137:report (default-cli) @ nexpose-root ---
[java] [INFO] Skipping JaCoCo execution due to missing execution data file:/Users/ecarey/rapid7/nexpose/nexpose/src/target/jacoco.exec

The execution data file is not correct. The destFile is set using the "jacoco.destFile" system property, but the dataFile does not respect this. I attempted setting "jacoco.dataFile" to no avail.

Evgeny Mandrikov

unread,
Jun 8, 2015, 2:41:11 PM6/8/15
to jac...@googlegroups.com, m...@errancarey.com, m...@errancarey.com
Hi,

Strange, but there is no user property by default - see http://www.eclemma.org/jacoco/trunk/doc/report-mojo.html
Discrepancy in names is also interesting question, but another story.

And in the meantime in order to use "jacoco.dataFile" you can add to pom.xml something like:

<plugin>
  <artifactId>jacoco-maven-plugin</artifactId>
  <configuration>
    <dataFile>${jacoco.dataFile}</dataFile>
  </configuration>
</plugin>

or even "${jacoco.destFile}", so that it will be set to the same value automatically.

Best regards,
Message has been deleted

m...@errancarey.com

unread,
Jun 8, 2015, 3:21:51 PM6/8/15
to jac...@googlegroups.com, m...@errancarey.com
Thanks Evengy, I'd actually just been looking at those docs. I thought it was strange no user property was defined there myself. I look forward to seeing progress on it. If I get the time I'd love to look into it myself.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages