Skip to content

Instantly share code, notes, and snippets.

@liyuntao
Last active August 29, 2015 14:15
Show Gist options
  • Save liyuntao/70c74e77c7b36dd6782b to your computer and use it in GitHub Desktop.
Save liyuntao/70c74e77c7b36dd6782b to your computer and use it in GitHub Desktop.
build a fat jar with all dependency inside with Gradle
task fatJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'Gradle Jar File Example',
'Implementation-Version': version,
'Main-Class': 'com.mkyong.DateUtils'
}
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment