How can run tasks periodicly in gradle?

(Jose Ayerdis) #1

I am trying to schedule tasks to run periodicly in gradle, in order to set a refresh rate of deployment similar to what maven has with jetty that redeploy your app if necesary.

It is annoying to keep running jettyRun everytime I do some small change.


PD. this is crossposting

(Szczepan Faber) #2

Hey Jose,

I don’t quite understand your use case. If you describe it better, and explain why you need to ‘keep running jettyRun’ we might be able to help you. Your stackoverflow question could be improved, too, to increase the chance other members help out.


(Jose Ayerdis) #3

Something similar to what the JettyRun documentation said

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

But it doesn’t said how. In maven is basicly


(Szczepan Faber) #4

Oh, it appears it’s not documented in the dsl reference. I’ll fix that, in meantime take a look at this property:

You need something like that:

myJettyRun {
   scanIntervalSeconds = 1

When interval <= 0 it is not used at all.

Hope that helps!