And I have some junit tests in the subprojects. I would like to generate jacoco report, but my build.gradle in my subproject does not generate coverage data.
Here is my build.gradle in one of the subprojects.
And I execute 'gradle sub-project1:test sub-project1:jacocoTestReport.
I want to generate the coverage data (.exec) first, but it doesn’t. Do I need to define something in the build.gradle in the root? Or is there something wrong with my command? I want to get one subproject working first and apply same thing to other subprojects.
I googled the solution and copied/pasted some samples for the past few dasy, but no luck.
I don’t see anything obviously missing. You shouldn’t need to configure the jacoco extension at all (the default is to put the execution data in build/jacoco/test.exec).
Yes. When I run it, it runs the tests. I see the html report and xml output file generated from junit. Actually, I just made it generate reports and jacoco coverage data like this.
It generates coverage data and reports, but it shows 0%. I see all the java class files compiled under build/classes/main and have all the java source files under src/main/java directory in my sub-projects