Re: Getting the groupid, artifact id, and version of the package under test

2022-03-30 Thread Alexander Kriegisch
It is actually easier than that, there is no need to use system properties. You can pass a parameter to an agent's 'premain' and 'agentmain' methods, which have signatures public static void premain( String commandLineOptions, Instrumentation instr ) public static void agentmain( String

Re: Getting the groupid, artifact id, and version of the package under test

2022-03-30 Thread John Patrick
I would do this via a profile, default value and surefire config, so something like; withJavaAgent -javaagent:C:\JARS\agent.jar maven-surefire-plugin ${myJavaAgent} -DtheGroup=${project.groupId} -DtheArtifact=${project.artifactId} Then if you want

Getting the groupid, artifact id, and version of the package under test

2022-03-29 Thread Laurian Angelescu
I am working on a Java agent that instruments test suites and the code under test. The agent runs by invoking the following command on the command line: mvn test -DargLine="-javaagent:C:\JARS\agent.jar" The apache surefire plugin takes care of running the tests and pushing the -DargLine argument