How to copy an artifact and its dependencies to a specific folder?


I was wondering how to copy an artifact and its dependency to a specific folder?

Reasons why: We have a parent project with sub projects.

I am using Gradle for the dependencies management (and some specific parts of the build) and ant for some other specific tasks. (I cannot use ant.importBuild due to this issue

Our Ant build script expect some libraries (findbugs libs) to be in a specific folder.

I would like my parent Gradle build to copy the artifacts and its dependencies ‘’ in a lib folder.

However I don’t know how to do this.

Thanks for Gradle,


repositories {
  configurations {
  dependencies {
    findbugs ''
  task copyFindBugs(type: Copy) {
    from configurations.findbugs
    into "lib"

If you want to run FindBugs on the Gradle side, you can instead use the ‘findbugs’ plugin.