Windows 10. JDK zulu188.8.131.52-ca-fx-jdk8.0.345-win_x64
I have an issue with Jenkins Jacoco plugin. It is not picking up the Java sources from other projects in the workspace. Because of this the coverage reports do not show the correct coverage information. It basically shows that none of the code has been covered by the test cases.
Here's my setup
- lib: all project lib jars are present here
- ProjectTest; contains Junit test cases. Depends on jars present in the lib folder.
- ProjectA: contains sources that are built and jar copied to lib
- ProjectB: contains sources that are built and jar copied to lib
- ProjectC: contains sources that are built and jar copied to lib
My Jenkins pipline has this:
Everything runs fine and coverage report are generated. However, only the sources present in the ProjectTest show coverage details. Sources from ProjectA, ProjectB and ProjectC dont show any any coverage.
Jenkins output shows:
[JaCoCo plugin] Saving matched source directories for source-pattern: **/src:
[JaCoCo plugin] Source Inclusions: */.java
[JaCoCo plugin] Source Exclusions:
[JaCoCo plugin] - c:\Projects\ProjectA\src 9 files
[JaCoCo plugin] - c:\Projects\ProjectB\src 7 files
[JaCoCo plugin] - c:\Projects\ProjectC\src 147 files
For some reason Jacoco has exlcudes all source of my projects in the workspace.
1. Why is Jenkins/Jacoco automatically excluding my project sources?
2. Is it possible to add those projects sources? If yes then how? I have tried various combinations such as: jacoco execPattern: '*/build/.exec', sourceInclusionPattern: './ProjectA,ProjectB//.java,*/.java', sourcePattern: '**/src', but nothing works.