-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PACT samples don't work for gradle builds #178
Comments
Was about to post this bug, but it's already registered. I will add more info on this. I was able to publish pact contracts from consumer_pact project successfully.
Sounds weird, because It's obvious that pact broker url is specified: spring-cloud-contract-samples/producer_pact/build.gradle Lines 59 to 61 in 787a660
Based on what I can see in debugger the problem is that I guess the classpath of Gradle's UPD: Found a workaround. Placing the following on the top of build script fixes the problem: buildscript {
dependencies {
classpath("org.springframework.cloud:spring-cloud-contract-pact:3.1.1")
}
} If you have a multi-module Gradle project, this should be placed into the root |
@shanman190 do you think we have a problem with the gradle plugin? |
@marcingrzejszczak, yeah this is a bug in the plugin. At the moment, we have the dependencies to enable use of local and git-based remote contracts. The Gradle plugin is presently doing the downloading from within the Gradle process itself which explains why when @gavvvr adds the pact dependency to Gradle's buildscript it then gains the capability to download pact broker based contracts. I do think we could shove the download work itself into a worker (assuming that Kotlin doesn't creep back into the classpath again) and take advantage of the I would have expected though that the dependency should be workable on the buildscript classpath anywhere the Spring Cloud Contract plugin is applied (ie. If it's on a root project, then the dependency needs to appear there; if it's only on a subproject, then the dependency could appear there per project as needed). |
Great, will you look into that in your spare time @shanman190 ? |
Absolutely, @marcingrzejszczak. I'll see about submitting a PR with the fix over the next few days. |
Thanks, I really appreciate it @shanman190 ! |
No description provided.
The text was updated successfully, but these errors were encountered: