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
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
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