If you want to exclude one file from resource, you may use this snippet:
sourceSets { main { resources { exclude '**/*.bak' } } }