Skip to content

Instantly share code, notes, and snippets.

@dryrain39
Created September 4, 2020 09:48
Show Gist options
  • Save dryrain39/3b1bd04e86bbdb37f10be1b98f2392ad to your computer and use it in GitHub Desktop.
Save dryrain39/3b1bd04e86bbdb37f10be1b98f2392ad to your computer and use it in GitHub Desktop.
fatjar
jar {
manifest {
attributes("Manifest-Version": "1.0",
"Main-Class": "your.package.name.HelloWorldApplication");
}
}
task fatJar(type: Jar) {
manifest.from jar.manifest
classifier = 'all'
from {
configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) }
} {
exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
exclude "META-INF/*.RSA"
}
with jar
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment