jarjacocojavaagents

Rename jar and it's classes


I want to run multiple jacoco javaagents on the same target with tcp ports. This causes an issue due to a naming conflict.

My thought is to rename the jacoco_agent.jar to jacoco2_agent.jar including all the class names.

I already tried jarjar, but that failed. Attaching the renamed jar raises an error. The ClassNotFoundException: org.jacoco.agent.rt.internal_3570298.PreMain occurs. Indicating that the naming did go wrong at some point.


Solution

  • 3 days ago Stefan wrote in a comment:

    @kriegaex your solution worked. Thank you very much for your help.

    Now that comment is gone, not sure why. Anyway, I am going to convert my comment into an answer:


    Are you aware of the option to merge multiple JaCoCo files into one for a complete coverage report? You can do this with the JaCoCo Maven plugin (e.g. for multi-module projects) as well as manually. Just make sure that your fuzzer creates different files for each run, then merge them in the end.