Hakkar
Hakkar

Reputation: 2431

Gradle - Copy jars to project folder

How would I copy dependencies to somewhere in the project folder with Gradle?

I've setup SBT to do this, but I'm not sure about Gradle

Upvotes: 4

Views: 3424

Answers (1)

ajoberstar
ajoberstar

Reputation: 2585

Your use case makes a big impact on the ways you could do this. But, answering generically you could do something like the following to copy from a collection to a directory.

task copyDeps(type: Copy) {
    from configurations.runtime
    into "${buildDir}/deps"
}

Tweak to meet your use case. If you are trying to create a Java application take a look at the application plugin.

Upvotes: 7

Related Questions