I have a very basic build script:
apply plugin: 'groovy'
apply plugin: 'application'
apply plugin: 'cobertura'
// Versions
ext {
coberturaVersion = '1.1.2'
}
repositories {
mavenCentral()
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'net.saliman', name: 'gradle-cobertura-plugin', version: coberturaVersion
}
}
Executing
gradle -q
will result in an error ‘No such property: coberturaVersion for class: org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler’
Using a property (defined in ext block) in the
dependencies
block like
dependencies {
compile group: 'org.codehaus.groovy:', name: 'groovy-all', version: groovyVersion
}
works perfectly fine. My expectation was, that referencing a property will work everywhere. Is there something that I missed in the documentation about this behavior, or is this a bug?