Jar with dependencies task for build.gradle


/ Published in: Groovy
Save to your folder(s)

Custom task using gradle java plugin for build runnable jar file with full dependencies set


Copy this code and paste it in your HTML
  1. apply plugin: 'java'
  2.  
  3. task full_jar(type: Jar, dependsOn: classes) {
  4. manifest {
  5. attributes 'Main-Class': "${project.group}.Main"
  6. }
  7. from configurations.compile.collect {it.directory ? it : zipTree(it)}
  8. from files(compileJava)
  9. baseName = "${project.archivesBaseName}-full"
  10. }

URL: build_gradle_jar_with_dependencies

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.