gradle-lint-plugin icon indicating copy to clipboard operation
gradle-lint-plugin copied to clipboard

Exception when dependency is defined with a variable

Open Blackbaud-JasonBodnar opened this issue 7 years ago • 0 comments

In build.gradle we have:

ext { ... spockVersion = "1.1-groovy-${groovyMinorVersion}-rc-2" ... }

Later on we have:

dependencies { ... mainTestCompile ("org.spockframework:spock-core:${spockVersion}") { exclude group: "org.codehaus.groovy" ... }

When I run gw clean boot everything compiles fine but when autoLintGradle runs I get the following exception:

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':autoLintGradle'.

Could not resolve all dependencies for configuration 'detachedConfiguration164'. Could not find org.spockframework:spock-core:$spockVersion. Searched in the following locations: file:/home/jbodnar/.m2/repository/org/spockframework/spock-core/$spockVersion/spock-core-$spockVersion.pom file:/home/jbodnar/.m2/repository/org/spockframework/spock-core/$spockVersion/spock-core-$spockVersion.jar https://nexus-oscf-dev.blackbaudcloud.com/content/groups/public/org/spockframework/spock-core/$spockVersion/spock-core-$spockVersion.pom https://nexus-oscf-dev.blackbaudcloud.com/content/groups/public/org/spockframework/spock-core/$spockVersion/spock-core-$spockVersion.jar Required by: com.blackbaud:optimus-prime:0.99999999

If I replace ${spockVersion} in the dependency definition with 1.1-groovy-2.4-rc-2 lint runs without exceptions.

Blackbaud-JasonBodnar avatar Apr 05 '17 20:04 Blackbaud-JasonBodnar