Closed geoHeil closed 8 years ago
The dependency management is overriding the version of spring-restdocs-core
back to 1.0.x. Easiest thing to do is to override the version property that's in the spring-boot-dependencies
bom:
ext['spring-restdocs.version']='1.1.0.M1'
You can then remove the version from your dependency:
testCompile 'org.springframework.restdocs:spring-restdocs-mockmvc'
I added your suggestion like:
dependencyManagement {
imports {
ext['spring-restdocs.version'] = '1.1.0.M1'
mavenBom("org.springframework.boot:spring-boot-dependencies:${springBootVersion}")
}
}
and the correct version seems to be loaded according to:
\--- org.springframework.restdocs:spring-restdocs-mockmvc: -> 1.1.0.M1
+--- org.springframework:spring-test:4.1.8.RELEASE -> 4.2.4.RELEASE (*)
\--- org.springframework.restdocs:spring-restdocs-core:1.1.0.M1
+--- javax.servlet:javax.servlet-api:3.1.0
+--- org.springframework:spring-webmvc:4.1.8.RELEASE -> 4.2.4.RELEASE (*)
\--- com.fasterxml.jackson.core:jackson-databind:2.4.6.1 -> 2.6.5 (*)
However, still the class is not found.
#edit
Finally after deleting the caches and deleting recreating the project using gradle idea
helped to solve the problem
Glad to hear that you figured it out. Thanks for following up.
Trying out the latest M1 release (https://github.com/spring-projects/spring-restdocs/blob/v1.1.0.M1/samples/rest-notes-spring-hateoas/src/test/java/com/example/notes/GettingStartedDocumentation.java) I stumbled upon a problem:
import org.springframework.restdocs.JUnitRestDocumentation;
I cannot resolve this class. Do you have any hints what is wrong with my dependencies?