Search code examples
tomcatgradlejvm-argumentsgradle-tomcat-plugin

Gradle Tomcat plugin set JVM arguments


I am using Gradle Tomcat plugin and wanting to set JVM arguments like: "-javaagent:/home/blablabla.jar" to "tomcatRun" tasks. I am using Gradle 2.4. I tried many examples , but failed. What is the right way to do it.


Solution

  • The embedded Tomcat container runs in the same JVM process as Gradle. You'll have to provide your JVM arguments when starting the Gradle process. You could probably just add it to the environment variable GRADLE_OPTS. What is it your are specifically trying to achieve?