This is my jar task:
jar{
description = 'Build with jar files'
exclude("src/main/resources/**")
manifest {
attributes 'Implementation-Title': 'title'
'Implementation-Version': 'text,
'Main-Class': 'mainclass',
'Class-Path': './lib/*'
}
}
My application resources are in src/main/resources and neatly organized per environment (dev, uat and prod). I have tried several versions of the above exclude statement, using relative and absolute paths but the resultant jar always contains my resources directory. How do I exclude my resources from my jar?
Edit: Is there a way to do this without editing the sourceSets[“main”].resources property?