How can I copy the resolved dependencies into a a project folder?


what is the common way to copy the resolved dependencies into a project folder ?

With ivy there is a task like

<ivy:retrieve resolveid="DCAG" pattern="lib/[type]/[artifact]-[revision].[ext]" ... />

that ensures that the resolved dependencies are not only copied into the artifact cache but at the same time into the project folder specified over the attribute ‘pattern’ of the retrieve task.

Regards Milan

There’s no direct equivalent in Gradle. You can’t explicitly push into the cache.

What naming pattern do you need for the deps in the destination?

What I need is that the dependencies of my project that are resolved to the gradle cache

are also copied to the projects lib folder. The pattern I need here is : lib/[type]/[artifact]-[revision].[ext]

Searching the old gradle nabble forum i came across this thread :

I wonder why its so complicated ! Could it not be more easy to say that all resolved dependencies are copied and synced with a projects lib folder ?

All that complication is just to copy with the appropriate naming convention. If you just want the files with [artifact]-[revision].[ext] then it’s very simple.

task libs(type: Sync) {
  from configurations.compile
  into "libs"


I use gradle for building subprojects. I need to copy all resolved runtime jar files into a special folder. How to do that? (That includes runtime and compile dependencies. We use the java and war plugin).

When I use the last pasted code in the allprojects block, then I also get all providedCompile dependencies with their transitiv dependencies. But that is not what I need. Because the provided compile dependencies are already on the webapplication.

Thx for showing the way.