How to remove all packages except one in a WAR file?


(Nicolas Bihan) #1

Hi,

I’m trying to remove a complete list of sub-packages except one in a war task.

Packages to remove from the war are

my.app.custom.foo

my.app.custom.bar

my.app.custom.test

… and 20 more my.app.custom.xxx packages

I want to include in my war

my.app.custom.kepler

So far I tried to exclude all and include only the one I want to keep but no success.

classpath = configurations.runtime
webInf {
  into('classes') {
   from sourceSets.main.output
    exclude('my/app/custom/**')
              from sourceSets.main.output
    include('my/app/custom/kepler/**')
    }
 }

I’m using Gradle 1.6

thanks, Nico