Just wanted to close the loop before contacting SonarQube. The issue appears not to be in Jacoco but instead in SonarQube. In the failed scenario and the workaround scenario we discovered the appended jacoco.exec is exactly the same. <https://github.ice.dhs.gov/ERO/earm/blob/ers-7776-earm-reports-coverage-mvp5/build/README.md#details> Details
Even if a child pom uses a different groupId from its parent if the artifactid name is the same the code coverage will disappear for all child modules. In app/pom.xml Changing <parent> <groupId>org.free2create.jacoco.mvp.reports</groupId> <artifactId>app-reports</artifactId> <version>7776.0.0.0-SNAPSHOT</version> <relativePath>../</relativePath> </parent> <groupId>org.free2create.jacoco.mvp.app</groupId> <artifactId>*app-reports*</artifactId> To <parent> <groupId>org.free2create.jacoco.mvp.reports</groupId> <artifactId>app-reports</artifactId> <version>7776.0.0.0-SNAPSHOT</version> <relativePath>../</relativePath> </parent> <groupId>org.free2create.jacoco.mvp.app</groupId> <artifactId>*app-reports-app*</artifactId> Works around the issue for the created demo code and in our real application. <https://github.ice.dhs.gov/ERO/earm/blob/ers-7776-earm-reports-coverage-mvp5/build/README.md#further-notes>Further Notes The Issue appears in a 3 level pom but not a 2 level pom: Can reproduce Top level(pom) Middle (pom) core(pom) app(war) Will not reproduce. Top level(pom) core(pom) app(war) On Thursday, June 4, 2020 at 8:52:37 PM UTC-4, the.ro...@gmail.com wrote: > > *Desired Outcome* > > Our maven project generates 2 applications/war files. The binary > jacoc.exec is uploaded to SonarQube. > > A Simplified structure looks like: > > Parent (pom) > > App1 (pom) > > app1-common (jar) > > app1-core (jar) > > app1-webapp(war) - Contains java code > > > > App2 (pom) > > app2-common(jar) > > app2-core(jar) > > app2-webapp(war) - Contains no java code > > > We expect to see code and coverage for all maven modules that contain java > code but noticed that code and coverage information was entirely missing > > app2-common(jar) > app2-core(jar) > > > > > We searched through the jacoco.exec file to verify that none of the > classes were present, just to make sure. > > If in the App2 aggregate pom we remove the app2-webapp module : > > Parent (pom) > > App1 (pom) > > app1-common (jar) > > app1-core (jar) > > app1-webapp(war) - Contains java code > > App2 (pom) > > app2-common(jar) > > app2-core(jar) > > > > the code coverage for > > app2-common > > app2-core > > > is displayed as expected. > > In the app2-webapp pom we tried adding > <properties> > > <jacoco.skip>true<jacoco.skip> > > <maven.test.skip>true</maven.test.skip> > > </properties> > > We also tried changing app2-webapp(war) to app2-webapp(jar) > Removing all of the maven plugins from app2-webapp > and limiting the dependencies to only > > app2-common(jar) > > app2-core(jar) > > > but still the code coverage for > > app2-common(jar) > > app2-core(jar) > > Is missing. > > *Environment*: Jenkins CentOS 7 and Oracle Java 8u151 , Jacoco 0.8.5 > uploading to SonarQube 7.X > > I have also tried using jacoco 0.7.9 with the same results. > > Does anyone know what I am missing ? > > > > > > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/5bd26fe7-d137-4acf-943a-d970c8873dado%40googlegroups.com.