I am trying to migrate a maven project to gradle. I am specifying the spring version for the entire project in the springVersion variable. But for some reason, the build fails with one specific dependency org.springframework: spring -web: springVersion . When I type the version directly org.springframework: spring -web: 3.1.2.RELEASE everything compiles. Here is my build.gradle file:
subprojects { apply plugin: 'java' apply plugin: 'eclipse-wtp' ext { springVersion = "3.1.2.RELEASE" } repositories { mavenCentral() } dependencies { compile 'org.springframework:spring-context:springVersion' compile 'org.springframework:spring-web:springVersion' compile 'org.springframework:spring-core:springVersion' compile 'org.springframework:spring-beans:springVersion' testCompile 'org.springframework:spring-test:3.1.2.RELEASE' testCompile 'org.slf4j:slf4j-log4j12:1.6.6' testCompile 'junit:junit:4.10' } version = '1.0' jar { manifest.attributes provider: 'gradle' } }
ERROR MESSAGE:
* What went wrong: Could not resolve all dependencies for configuration ':hi-db:compile'. > Could not find group:org.springframework, module:spring-web, version:springVersion. Required by: hedgehog-investigator-project:hi-db:1.0
Same thing with org.springframework: spring -test: 3.1.2.RELEASE when running tests.
What causes his problem and how to solve it?
java gradle
kamuflage661
source share