Exclude Transitive Source Jars from WAR Output

(Steven Dick) #1

When I use the WAR plugin the source jars and license files from my transitive dependencies are being included in the WEB-INF/lib output. How do I exclude them?

(Steven Dick) #2

I came up with a solution myself, but I’m assuming there’s a more elegant way of achieving this: war {

classpath = classpath - classpath.filter {

it.name.endsWith(’.txt’) || it.name.endsWith(’.zip’) || it.name.contains(’-sources’) || it.name.endsWith(’.xsd’) || it.name.contains(’-javadoc’)