How do I build a war file with Gradle using a copySpec containing filesMatching -


so, works:

war {     filesmatching('**/index.jsp') {         filter(org.apache.tools.ant.filters.replacetokens, tokens: [           'version' : version,         ])     } } 

but not:

def webappfilter = project.copyspec {     filesmatching('**/index.jsp') {         filter(org.apache.tools.ant.filters.replacetokens, tokens: [           'version' : version,         ])     } }  war {     webappfilter } 

obviously, i'm doing wrong, can't understand i'm missing. can help?

i had similar problems copyspecs gradle not using them. after having tried out many variants worked me when adding copy closure copyspec.

def cs = copyspec {     copy {         from("readme.txt")         into("somefolder")         filter{string line -> line.replaceall('a','b')}     } }     task mycopy (type: copy) {     cs  }  

hope helps.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -