CopySpec.with() creates a child spec, which means your filter will only be applied to child spec, not the root spec, which is what you want. You’ll want to call filesMatching() from directly within the war { } block.
There’s no need to duplicate CopySpec-specific code in gretty and War task. You can hold all filtering code in gretty.webappCopy. Gretty automatically reconfigures War task with gretty.webappCopy.