views:

19

answers:

1

I need to deploy my code to another machine. How do I export the dependent jars to a lib directory?

+2  A: 

I am not sure if this is the correct way, but to copy the jars to a lib directory I do the following:

/**
 * Copies the dependencies to the lib directory in preparation for them to be added to a jar file
 */
 task copyRuntimeDependencies(dependsOn: configurations.runtime.buildArtifacts, type: Copy) 
  {
    into('build/output/lib')
    from configurations.runtime
    from configurations.runtime.allArtifacts*.file
  }
Shawn