Load Execution Data during report aggregate from outside of Project BaseDir in a Maven project

15 views
Skip to first unread message

ashfaqur...@gmail.com

unread,
Dec 13, 2018, 5:58:17 AM12/13/18
to JaCoCo and EclEmma Users
In a maven multimodule project, using the jacoco report-aggregate requires default build directory of Maven:
<directory>${project.basedir}/target</directory>
since the ReportAggregateMojo.java is using the Project BaseDir to look for execution data.
https://github.com/jacoco/jacoco/blob/master/jacoco-maven-plugin/src/org/jacoco/maven/ReportAggregateMojo.java

If a project is using a different <directory> location, is it possible to tell the jacoco to use the this directory to load the execution files instead of the default ${project.basedir}?

Marc Hoffmann

unread,
Dec 13, 2018, 10:41:08 AM12/13/18
to jac...@googlegroups.com
Hi,

as long as the exec files are still somewhere under the base directory of each project you can specify an arbitrary lookup pattern using the dataFileIncludes property.

Having the exec files outside the projects is not supported. As a workaround you might copy the exec files onto the respective projects or use the merge goal to merge the exec files into a exec file to the project that you use to generate the aggregated report.

Regards,
-marc
> --
> You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/107c6e41-60e7-4121-868b-a7adf3f8cf45%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

ashfaqur...@gmail.com

unread,
Dec 13, 2018, 10:57:38 AM12/13/18
to JaCoCo and EclEmma Users
Workaround will not work since the jacoco plugin is looking for the classes of code under test also under each project directory (afaik) in-order to generate the report.

But thanks for your input.

Would be handy to have that feature to override the lookup directory though.

Evgeny Mandrikov

unread,
Dec 14, 2018, 7:38:17 AM12/14/18
to JaCoCo and EclEmma Users


On Thursday, December 13, 2018 at 4:57:38 PM UTC+1, ashfaqur...@gmail.com wrote:
Workaround will not work since the jacoco plugin is looking for the classes of code under test also under each project directory (afaik) in-order to generate the report.

Location of classes doesn't depend on location of exec-files.
 

But thanks for your input.

Would be handy to have that feature to override the lookup directory though.


As another workaround with full control of paths you can use JaCoCo Ant Tasks ( https://www.jacoco.org/jacoco/trunk/doc/ant.html ) via maven-antrun-plugin,
or even JaCoCo Command Line Interface ( https://www.jacoco.org/jacoco/trunk/doc/cli.html ).

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages