Problem
I’m getting this error message in a 2.14 project:
FAILURE: Build failed with an exception.
* Where:
Settings file 'E:\dev\myProject\settings.gradle' line: 3
* What went wrong:
A problem occurred evaluating settings 'myProject'.
> Could not get unknown property 'artifactoryBaseUrl' for object of type org.gradle.plugin.repository.internal.DefaultMavenPluginRepository.
Gradle Files
Here is settings.gradle:
pluginRepositories {
maven {
url "$artifactoryBaseUrl/libs-local"
credentials {
username mavenRepoUser
password mavenRepoPassword
}
}
maven {
url "$artifactoryBaseUrl/plugins-release"
credentials {
username = mavenRepoUser
password = mavenRepoPassword
}
}
gradlePluginPortal()
}
Here is gradle.properties:
mavenRepoUser=myArtifactoryUser
mavenRepoPassword=myArtifactoryPassword
artifactoryBaseUrl=http://artifactory.service.net
Question
Why is settings.gradle not able to find properties defined in gradle.properties?
Observations
If I replace the property names in settings.gradle with their string literals, not only does the error go away, but these same properties are successfully resolved within build.gradle, which makes use of the same properties. So, it seems that only settings.gradle is having this problem.
Environment
Windows 8.1, jdk 1.8.0_u91 (64-bit)
build.gradle, settings.gradle, and gradle.properties are all co-located in the same project directory. I have no gradle.properties file in my user home directory.
I’m using the 2.14 gradle wrapper with this command line:
gradlew tasks
Here are the contents of MANIFEST.MF found in gradle/wrapper/gradle-wrapper.jar:
Manifest-Version: 1.0
Implementation-Title: Gradle
Implementation-Version: 2.14
Here are the contents of gradle/wrappper/gradle-wrapper.properties:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14-bin.zip