Hot deploy with Jetty Plugin's jettyRun?

How do I enable hot redeploy using the Gradle Jetty plugin, similar to the Maven Jetty plugin?

The documentation page ( goes on at length that this is possible:

“Once started, the web container can be configured to run continuously, scanning for changes in the project and automatically performing a hot redeploy when necessary. This allows the developer to concentrate on coding changes to the project using their IDE of choice and have those changes immediately and transparently reflected in the running web container, eliminating development time that is wasted on rebuilding, reassembling and redeploying.”

I’ve seen miscellaneous references to a reload property (set to ‘automatic’ or ‘manual’) and a few to a scanInterval property, but I can’t seem to make it work.

Thanks in advance!

I’ve asked something similar.

Thanks! I hope we can find an answer!

There’s a lot I like about Gradle, but this is one of those biggies for me.

Have you figured this out? I’ve been googling like crazy. I’m using html5 files with thymeleaf. Every time I edit a file I have to do a: gradle clean jR

Nope. I eventually gave up.

Reloading is controlled by two properties on the ‘jettyRun’/‘jettyRunWar’ tasks: ‘reload’ and ‘scanIntervalSeconds’. (These properties seem to be missing from the Gradle Build Language Reference, but they can be found in the Groovydoc). ‘reload’ defaults to ‘“automatic”’. The other allowed value is ‘“manual”’, which should reload whenever you press Enter. ‘scanIntervalSeconds’ defaults to ‘0’, which disables automatic reloading. To activate automatic reloading, set it to a value greater than zero:

jettyRun {
    scanIntervalSeconds = 10

Disclaimer: I haven’t verified that this works.

I tried with

jettyRun {
    reload = "automatic"
    scanIntervalSeconds = 1

but running with jettyRun seems not to make reloading effective. Changes to my Spring controller are not picked up unfortunately.

Did you compile this class?Jetty will reload your application only after change you byte code, that is after compile. Please note that if you will use IDE - check that output compile dirs matches working jetty dirs.


So, I’ve been looking for a way to hot deploy for a few days using the jetty plugin for gradle. I had no luck whatsoever. Jetty checks the build for any changes, whereas the changes that take place are in src. Changing jetty to watch the src folder seemed messy to me.

Instead I used the tomcat plugin for gradle. Hot deployment is already configured in the plugin so just making the requisite changes to build.gradle did the trick. Hot deployment with gradle works for me now… a HUGE timesaver :slight_smile: If anyone has been able to hot deploy using jetty with gradle please share it… until then tomcat is the way to go

Firstly, you should configure like this jettyRun {

reload = “automatic”

scanIntervalSeconds = 1 }

then, you should issue that command:

gradle compileJava (or classes) in another terminal!

and wait for one second, it will work!

you know, the jetty should watch the .class files changing other than the plain file(source code)

If you can live with a jetty 9, try my gradle plugin for it. I am following a different strategy with it, but it has similar features (autoreload of new war file, manual or automatic rebuilds etc.)

Here it is, hope it helps: