Posted By

alces on 03/12/13


Tagged

java jar gradle buildgradle dependensies


Versions (?)

Jar with dependencies task for build.gradle


 / Published in: Groovy
 

URL: build_gradle_jar_with_dependencies

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

  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. }

Report this snippet  

You need to login to post a comment.