Failed to generate jacoco report for multiple module maven project

1,436 views
Skip to first unread message

stanle...@servicemax.com

unread,
Dec 28, 2016, 11:08:30 PM12/28/16
to JaCoCo and EclEmma Users
Hello, all

I am trying to generate jacoco report for our project.
There are about 40 sub modules, and an integration testing project which relay on most of them.


I am following this page, and I can generate the report for other project except intergration project.
 
[ERROR] Failed to execute goal org.jacoco:jacoco-maven-plugin:0.7.8:report (jacoco-site) on project test.ss.integration_test_suite: An error has occurred in JaCoCo report generation. Error while creating report: Error while analyzing /home/test/workspace/test-jacoco/integration_test_suite/target/classes/ruby/gems/gems/jruby-openssl-0.9.18-java/lib/org/bouncycastle/bcpkix-jdk15on/1.55/bcpkix-jdk15on-1.55.jar@org/bouncycastle/cert/AttributeCertificateHolder.class. Can't add different class with same name: org/bouncycastle/cert/AttributeCertificateHolder -> [Help 1]

I am trying to exclude this class in maven-dependency-plugin and it seems it doesn't work.

<excludes>org/bouncycastle/cert/AttributeCertificateHolder.class</excludes>

I tried to exclude jars, then this error doesn't show up, but the integration project fails to start.

Is there any suggestion for this problem?


Thanks for help in advance.

Evgeny Mandrikov

unread,
Dec 29, 2016, 4:25:31 AM12/29/16
to JaCoCo and EclEmma Users
Hi,

Have you tried to exclude "ruby/gems" all together from report generation - see http://www.jacoco.org/jacoco/trunk/doc/report-mojo.html#excludes ?

stanle...@servicemax.com

unread,
Dec 29, 2016, 5:04:55 AM12/29/16
to JaCoCo and EclEmma Users
In my case, the report is executed via ant task, I didn't figure out how to set the exclusion.

              <target>
                <taskdef name="report" classname="org.jacoco.ant.ReportTask"
                  classpathref="maven.plugin.classpath" />
                <ant antfile="${basedir}/build.xml" />
              </target>


Another thing I found is that right now most project can show the code coverage in their folder, in integration module, I also can see the jacoco.exec file.
But it shows nothing, all those code test in integration test cases are not shown.
Based on the page, I also copied related  source/class file to target folder of integration project, but it seems it doesn't help.

Do we have more guides on how to set up code coverage for multiple projects, UTs and ITs.

Evgeny Mandrikov

unread,
Dec 29, 2016, 6:38:24 AM12/29/16
to JaCoCo and EclEmma Users
Exclude files on a level of Ant resources before passing to JaCoCo report task. For example fileset has exclusions - https://ant.apache.org/manual/Types/fileset.html

Some time ago JaCoCo project itself was using Ant task from Maven to generate report that crosses boundaries of modules - see https://github.com/jacoco/jacoco/blob/v0.7.4/org.jacoco.doc/pom.xml#L90 as an example

But this was superseded by a native support with Maven - see http://www.jacoco.org/jacoco/trunk/doc/report-aggregate-mojo.html

stanle...@servicemax.com

unread,
Dec 30, 2016, 1:42:13 AM12/30/16
to JaCoCo and EclEmma Users
Thanks, exclude files on ant resource level works for me.
And I figure out why the coverage report didn't work for me, we specified failsafe arguments, which overrides the argument created by jacoco.

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