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 (http://www.gradle.org/docs/current/userguide/working_with_files.html#sec:copying_files) or have a look at the gradle dsl reference for details

cheers,
René
 

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

http://forums.gradle.org/gradle/topics/war_plugin_rename_jars_included_in_web_inf_lib

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