How to add a jar file such as 'Jacoco code coverage agent' in Keycloak classpath?

Custom code written as providers are packaged as jar files and used with Keycloak in my scenario.

  • I have used a ‘maven jacoco plugin’ to instrument the code of these providers and generate the custom provider jars that resides inside “/providers” directory.
  • By using a ‘Jacoco agent’, these providers’ code execution and coverage can be tracked from a testing perspective.

I am unable to find a way to specify the ‘jacocoagent.jar’ in the Keycloak classpath, as loading of the instrumented provider classes depend on it.

I tried :

  • adding the agent jar inside ‘modules’ directory hierarchy.
  • used ‘java -cp’ in standalone.bat to specify classpath.
  • added jacocoagent.jar in /providers directory.

But was unsuccessful

Please specify an approach in which a jar file such as the ‘jacocoagent.jar’ can be specified in the Keycloak classpath before bringing the application up. That would allow me to track the execution and code coverage of my custom providers.