jacoco aggregates code coverage under same sourcefilename if both root and sub-project(dependency) has file with same class file name

20 views
Skip to first unread message

Suresh Ramachandra

unread,
Nov 6, 2020, 12:30:25 PM11/6/20
to JaCoCo and EclEmma Users
Hello, 

I am working on a a gradle project which uses Jacoco has the code coverage tool and SonarQube as the reporting tool.

The project has a dependency on another package which has a class file with the same name as in the root project.

So, the root project has dsl.kt file and also the dependent/sub-project has dsl.kt file.

For this scenario, Jacoco consolidates code coverage from both class files (in root and dependent package) and puts it in the same 'sourcefile name' which is dsl.kt.

When this report is read by SonarQube, it returns 'line out of coverage' error for the class file as the line numbers reported by Jacoco doesn't match with the actual class file.

I do not have a sample project to share the xml report but I can try if needed. 

Please let me know if anyone has a solution/work around for this.

Regards,
Suresh
Reply all
Reply to author
Forward
0 new messages