Here ProjectA is gradle project and each packages(Service1, Service2, Service3) under the ProjectA acts like a microservice.
ProjectA
- Service1
- ClassA
- ClassB
build.gradle
- Service2
- ClassC
- ClassD
build.gradle
- Service3
-ClassE
- Class F
build.gradle
build.gradle (for entire ProjectA)
a. Now i wanted to have a jacoco coverage only for specific classes inside each package(say ClassA, ClassD and ClassF) in build.gradle(ProjectA) and generate a html coverage report for it.
Can someone help me in this?
b. Also Usually the report gets generated in target/site/jacoco/index.html but is it possible to specify our own path where the report needs to be generated?
Can someone guide me how we can generate reports for specific classes in our own predefined path?
Thanks in advance.
Have a look at the Gradle Jacoco plugin documentation, you will see that:
jacoco.reportsDir
includes
andexcludes
on the Jacoco extension available at the task level. Sotest.jacoco.includes
for the defaulttest
task.