task BuildJar(type: Jar) {
manifest {
attributes(
'Main-Class': 'org.mycompany.mainclass'
)
}
classifier = 'all'
baseName = 'MyJar'
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
{
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
with jar
}