Closed rivancic closed 8 months ago
Seems similar to this one, while I don't use test suites in the project, just unit5 platform. https://github.com/spring-cloud/spring-cloud-contract/issues/1863
Gradle 8.6 release doesn't mention much about test suites, so I'm wondering form where does the breaking change come. https://github.com/spring-cloud/spring-cloud-contract/issues/2099
Closing as duplicate of gh-2098.
Describe the bug
I'm using following versions
org.springframework.cloud:spring-cloud-contract-gradle-plugin:4.0.3
When upgrading from Gradle 8.5 to 8.6 I get following message when project goes through the configuration phase:
I think issue originates from this place SpringCloudContractVerifierGradlePlugin.java#L147
Gradle 8.5 version of JvmComponentDependencies JvmComponentDependencies is annotated with
@Incubating
annotation means it can change anytime.Gradle 8.6 changed org.gradle.api.artifacts.dsl.DependencyAdder to org.gradle.api.artifacts.dsl.DependencyCollector.
Now I got it its the same issue as -> https://github.com/spring-cloud/spring-cloud-contract/issues/2098
Code in the plugin didn't change much around contractTestSuite dependencies.
I assume to be compatible with Gradle 8.6 internal API you'll have to compile this plugin with Gradle 8.6 version. Or use plugin like mentioned here: https://discuss.gradle.org/t/compile-gradle-plugin-against-different-api-version/40281/2 https://github.com/gradle-plugins/toolbox To specify internal Gradle API version: https://github.com/spring-cloud/spring-cloud-contract/blob/main/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/build.gradle#L70
Current one is build with Gradle 8.3
4.0.3 is build with 7.6.1
Sample
I'll provide a sample application later.
Exception Stack Trace
Whole stack trace:
gradle-stub-exception.txt