How to run jettyRun with jvm flag to set JRebel javaagent?

It is possible to set javaagent in jettyRun task?

I would like to use JRebel in combination with Jetty to auto reload classes…

Note that http://www.gradle.org/docs/current/userguide/jetty_plugin.html only mentions 3 properties (httpPort, stopPort, stopKey) but http://www.gradle.org/docs/current/dsl/org.gradle.api.plugins.jetty.JettyRun.html mentions more.

But unfortunately I don’t see anything related to providing jvm flags.

I used the gradle.properties to workaround this by putting the below in gradle.properties:

org.gradle.daemon = true
org.gradle.jvmargs = "-javaagent:/Applications/jrebel/jrebel-5.3.1/jrebel.jar"

I only wonder if I can refer to system properties inside the jvmargs property String. Something like

"-javaagent:${env.REBEL_HOME}/jrebel.jar"

Any ideas?

No you can’t. It’s a plain properties file.

Can I set the jvmargs then via build.gradle maybe?

Unfortunately, ‘gradle.properties’ is the only option, as the ‘jetty’ plugin executes Jetty in the Gradle JVM.

The ‘jetty’ plugin has a lot of weaknesses, and we plan to replace it with a solution based on the Arquillian Gradle plugin. I encourage you to try that plugin today, and report back how it works for you.

Is the arquillian plugin still what you are aiming at using to replace the jetty plugin? Seems like it hasn’t been maintained for a while and we would like to extend one of the plugins to use the jrebel agent.

A decision hasn’t been made. I’d recommend to evaluate the Arquillian, Cargo, and Tomcat plugins, and choose what fits best for your needs.

thanks for the prompt reply! We will evaluate all the plugins and see which one is more suited for what we need. Thanks!