In my project based on environment variable different set of integration tests are run. For e.g.
mvn test -Dconfig=a
mvn test -Dconfig=b
Running both lines gives full test coverage.
Now the problem is that each run will create a jacoco.exec file in the target folder, but the second run will override the first by deleting the target folder.
I want to use jacoco merge to combine the exec files but I am not sure how to go about it.
I can change the output directory to somewhere else other than target and merge but then how will I maintain version or do I have to add a line to delete the folder after merge is done.
Any help would be appreciated
You can generate a separate exec as per your run/s. ( eg
a.exec
andb.exec
) post that you can usejacoco:merge
plugin to merge your exec files to get one exec, which will have your complete coverage.Reference for merging exec files via maven.