How to exclude particular file, in my case log4j.xml from resulting war archive when executing war task


(Eugene Dvorkin) #1

How to exclude particular file, in my case, log4j.xml, from war archive when executing war task?

I did not find any solution yet that I can put into war task.

thanks


(Peter Niederwieser) #2

Have you tried a straightforward ‘exclude’ (see ‘War’ task in DSL reference)?


(Eugene Dvorkin) #3

Yes. I did

war {

excludes [’**/log4j.*’]

}

still see log4j.xml in a war archive. Thanks


(Peter Niederwieser) #4

Your pattern is incorrect. Try:

war {
  exclude "**/log4j.xml"
}

(Eugene Dvorkin) #5

Peter, neither

war {
  exclude "**/log4j.xml"
}

nor:

war {
  excludes ["**/log4j.xml"]
}

are working. I still see log4j.xml in my classpath


(Peter Niederwieser) #6

Strange. Can you provide a reproducible example?