I want to use Gradle to download several webdrivers for our Selenium testing project. the webdrivers are located in our Nexus server.
here’s my build.gradle script:
apply plugin: 'java'
buildscript {
repositories {
maven {
url "http://nexus:8081/nexus/content/groups/public"
}
}
dependencies {
classpath "com.company:chromedriver-mac32:2.8@bin"
}
}
task copyDrivers(type: Copy) {
file driversLocation = file("$buildDir/drivers-down")
mkdir driversLocation
into driversLocation
from buildscript.dependencies
}
the problem is that the downloaded dependency (chromedriver-mac32 in the example above) is not copied to the new folder (build/drivers-down).
console output:
~/projects/e2e>gradle copyDrivers
Creating properties on demand (a.k.a. dynamic properties) has been deprecated and is scheduled to be removed in Gradle 2.0. Please read http://gradle.org/docs/current/dsl/org.gradle.api.plugins.ExtraPropertiesExtension.html for information on the replacement for dynamic properties.
Deprecated dynamic property: "driversLocation" on "task ':copyDrivers'", value: "/Users/alexey/projects...".
:copyDrivers
Converting class org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler to File using toString() method has been deprecated and is scheduled to be removed in Gradle 2.0. Please use java.io.File, java.lang.String, java.net.URL, or java.net.URI instead.
:copyDrivers UP-TO-DATE
am I using the right approach?
I think ideally I’d want to tell Gradle something like this: I have these 3 artifacts located in this Nexus repository, download them into this folder. that’s it.