Intercept copy task in war pluggin

hi guys,

I was wondering if it is possible to intercept the copy task in war plugging while copying static resources such as .js and .css to the exploded dir or war file. I would like to to rev filenames.

Thanks, Jorge

Hey Jorge,
The war task provides a 'rename’method. Have a look at the gradle userguide ( or have a look at the gradle dsl reference for details


You might also need to use the ‘rootSpec’ property for this to work in the ‘war’ task.

Thanks, for both answers. Actually i figured out what i need

Besides renaming files, i need to change the name of the .js ,.css files destination directory inside the .war file. I

Change from js/main/ to js/main/v1 and put all my .js and .css file. Is there any copy task in war pluggin?

Try looking up some examples that use the ‘eachFile’ method from the copySpec