How to exclude a file from src/main/resources from the WAR file?

Well the file path I want to exclude from WEB-INF/classes is:

src/main/resources/dev.properties

It’s not really that a particular expression is working unexpectedly – I’ve tried a few things that don’t seem to work, but in most I cases I think I understand why. So now I just can’t find one that does what I want and trial and error is getting tiresome.

Here are some examples of what I’ve tried:

//try 1 (doesn't work)
exclude('../resources/dev.properties')
//try 2 (doesn't affect resources copied to classes/ dir)
 from('build/resources/main'){
   exclude 'dev.properties'
 }
//try 3
excludes = ['**/dev.properties']
//try 4: doesn't exclude the file and has weird effect of duplicating all jars in WEB-INF/lib...
classpath = classpath - files('resources/dev.properties')