The following code generates an error on the second reference to the project property ‘SpringVersion’.
plugins {
id “io.spring.dependency-management” version “0.2.1.RELEASE”
}
ext.SpringVersion=‘3.2.3.RELEASE’
dependencies {
compile(group: ‘org.springframework’, name: ‘spring-aop’, version: “$SpringVersion”)
}
dependencyManagement {
dependencies {
dependencySet(group: ‘org.springframework’, version: “$SpringVersion”) {
entry ‘spring-beans’
entry ‘spring-core’
}
}
}
The property can be successfully referenced in Gradle’s DependencyHandler, but it cannot be referenced by the plugin. It generates the following error.
No such property: $SpringVersion for class: io.spring.gradle.dependencymanagement.DependenciesHandler
What needs to be done in a custom plugin to reference project properties?