Skip to content

Instantly share code, notes, and snippets.

@isa
Forked from paulwoods/gist:1142106
Created May 4, 2012 00:35
Show Gist options
  • Save isa/2590709 to your computer and use it in GitHub Desktop.
Save isa/2590709 to your computer and use it in GitHub Desktop.
gradle - exclude files from a jar.
jar {
manifest {
attributes "Implementation-Title": "Gradle Quickstart"
attributes "Implementation-Version": version
attributes "Main-Class" : "com.ti.specteam.programs.Application"
}
// remove the security files (from mail.jar / activation.jar) so that the jar will be executable.
doFirst {
from (configurations.runtime.resolve().collect { it.isDirectory() ? it : zipTree(it) }) {
exclude 'META-INF/MANIFEST.MF'
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
exclude 'META-INF/*.RSA'
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment