How do you specify java agent in gradle build


(Sharad Goyal) #1
    jvmArgs = ["-javaagent:spring-instrument-3.2.3.RELEASE.jar -Dorg.aspectj.tracing.enabled=true -Daj.weaving.verbose=false -Dorg.aspectj.weaver.showWeaveInfo=false -DcontainerNamespace=atp2sxg -Dspring.profiles.active=PooledConDS"]

How do you specify java agent in gradle using jvmArgs?


(Dimitar Dimitrov) #2

The cmd line args need to be properly split, like this:

jvmArgs = [
  "-javaagent:spring-instrument-3.2.3.RELEASE.jar",
  "-Dorg.aspectj.tracing.enabled=true",
  "-Daj.weaving.verbose=false",
  "-Dorg.aspectj.weaver.showWeaveInfo=false",
  "-DcontainerNamespace=atp2sxg",
  "-Dspring.profiles.active=PooledConDS"
]

Also, you may want to use systemProperties instead of passing -Dxxxx=yyy args.


(Sharad Goyal) #3

How do I specify multiple java agent?


(Benjamin Muschko) #4

You can simply define multiple -javaagent JVM arguments.