The following build:
apply {
plugin 'java'
plugin 'maven'
}
repositories {
maven {
url = 'http://somerepo/nexus/content/repositories/snapshots'
}
}
uploadArchives {
repositories {
mavenDeployer {
repository {
url = 'file:///tmp/maven_repo'
}
}
}
}
results in the following warning being printed out
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: "url" on "[]", value: "file:///tmp/maven_repo".
This also means that this does not delegate to the maven repository being configured with the closure, which can make the builds fail.
Changing the deployer configuratin to following works fine:
uploadArchives {
repositories {
mavenDeployer {
repository(url: 'file:///tmp/maven_repo')
}
}
}
The DSL is inconsistent: dependency repositories can be configured with closures with setters, the deployer cannot.