im trying to update from spring-boot 3.1.9 to 3.3.1.
When i update tests using wiremock start failing.
I read about the standalone version,
and have updated my gradle script accordingly from "com.github.tomakehurst:wiremock:3.0.0-beta-10" to "com.github.tomakehurst:wiremock-standalone:3.0.1"
However i also have a spring "org.springframework.cloud:spring-cloud-starter-contract-stub-runner:4.1.2")
dependency and that one in turn uses wiremock-jre8-standalone
i have tried to manually remove that one like so
testImplementation("com.github.tomakehurst:wiremock-standalone:3.0.1")
testImplementation("org.springframework.cloud:spring-cloud-starter-contract-stub-runner:4.1.2") {
exclude(group = "com.github.tomakehurst", module = "wiremock-jre8-standalone")
}
and force the new one to be used
configurations.all {
resolutionStrategy {
force("com.github.tomakehurst:wiremock-standalone:3.0.1")
}
}
configurations.all {
exclude(group = "com.github.tomakehurst", module = "wiremock-jre8-standalone")
}
however i still get the same result
Caused by: java.lang.NoSuchMethodError: 'void com.github.tomakehurst.wiremock.extension.responsetemplating.ResponseTemplateTransformer.<init>(boolean)'
at org.springframework.cloud.contract.wiremock.WireMockConfiguration.init(WireMockConfiguration.java:107)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMethod.invoke(InitDestroyAnnotationBeanPostProcessor.java:457)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:401)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:219)
... 29 more
i have followed the advice here removing the dependency and keeping only the one from spring-cloud, however I still have the same issue. https://github.com/spring-cloud/spring-cloud-contract/issues/2104#issuecomment-1962882969