Download some dependencies and copy them to a local folder

In the ‘buildscript’ block, dependencies of the build script itself are declared (most commonly third-party Gradle plugins). Instead, you want something like this:

apply plugin: "java"
  repositories {
    maven {
        url "http://nexus:8081/nexus/content/groups/public"
    }
}
  configurations {
    drivers
}
  dependencies {
    drivers "com.company:chromedriver-mac32:2.8@bin"
}
  task copyDrivers(type: Copy) {
    from configurations.drivers
    into "$buildDir/drivers-down"
}
2 Likes