-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
Since 4.3.16 pact publish configuration can not be found #1634
Comments
Looks like this is still broken in 4.4.2 using this example config
|
Appending this to the previous example is a strange/buggy but working workaround:
|
@rholshausen could someone please answer on this? is this really a bug regarding the task registration code change or do we miss something here ? |
Sorry, I don't know what is causing this. As soon as I have some time, I'll try to replicate it. |
I can't replicate this issue. 4.3.16 works fine on Pact-JVM project as well as my test project. I created this empty Gradle project https://github.com/rholshausen/issue-1634 using Gradle 7.5.1 and Pact-JVM gradle plugin 4.3.16, added the snippet above, but it works without the error displayed above. ❯ ./gradlew tasks
> Task :tasks
------------------------------------------------------------
Tasks runnable from root project 'issue-1634'
------------------------------------------------------------
Build Setup tasks
-----------------
init - Initializes a new Gradle build.
wrapper - Generates Gradle wrapper files.
Help tasks
----------
buildEnvironment - Displays all buildscript dependencies declared in root project 'issue-1634'.
dependencies - Displays all dependencies declared in root project 'issue-1634'.
dependencyInsight - Displays the insight into a specific dependency in root project 'issue-1634'.
help - Displays a help message.
javaToolchains - Displays the detected java toolchains.
outgoingVariants - Displays the outgoing variants of root project 'issue-1634'.
projects - Displays the sub-projects of root project 'issue-1634'.
properties - Displays the properties of root project 'issue-1634'.
resolvableConfigurations - Displays the configurations that can be resolved in root project 'issue-1634'.
tasks - Displays the tasks runnable from root project 'issue-1634'.
Pact tasks
----------
canIDeploy - Check if it is safe to deploy by checking whether or not the specified pacticipant versions are compatible
pactPublish - Publish your pacts to a pact broker
pactVerify - Verify your pacts against your providers
To see all tasks and more detail, run gradlew tasks --all
To see more detail about a task, run gradlew help --task <task>
BUILD SUCCESSFUL in 303ms
1 actionable task: 1 executed
issue-1634 on main via ☕ v11.0.12 via 💎 v2.7.6
❯ ./gradlew pactPublish
BUILD SUCCESSFUL in 287ms
1 actionable task: 1 executed
issue-1634 on main via ☕ v11.0.12 via 💎 v2.7.6
❯ |
What JDK are you using? I was using 11.0.2 |
17.0.4 |
I couldn't get 17.0.4, but I tried 17.0.5, and it worked ok, so that is not the issue |
I have removed the |
@rholshausen thanks for the investigation.. we have the following plugin in our project which seems may to interfere with the latest changes to this plugin so to reproduce the issue you need to add the following to your example project settings.gradle
semantic-build-versioning.gradle
the maybe this helps to solve this issue |
@eloo that looks like a different problem that the one originally reported. Adding that plugin causes Gradle to fail with |
@rholshausen Gradle 7.5 but the real question is what happen between 4.3.15 and 4.3.16 which causes such weird errors |
You can check either the changelog or use GitHub to get all the differences between 4.3.15 and 4.3.16, but I expect it was this PR #1627 |
i'm not that familiar with gradle plugin development so i can't really see why this PR behaves likes this.
task on root level and not in
|
No, that is only a property on a task, and it is assigned when the task is registered. See https://github.com/pact-foundation/pact-jvm/blob/master/provider/gradle/src/main/groovy/au/com/dius/pact/provider/gradle/PactPlugin.groovy#L26 and it is meant to do the same as the fix above. I have released a new version with the optional annotation removed, however, I have no idea if that will make a difference. More likely it will only change the error message. What you can try do, fork the repo and change PactPlugin.groovy:26 to use |
Hmm, I wonder if the property having the same name as the task might be impacting things. |
with the new version without optional i get a different error.. but its indicating the same.. the value is not set
|
So yes it looks like gradle is trying to resolve the property on root level and not inside the task configuration. |
I am experiencing a similar issue to what @eloo posted above. Prior to version 4.3.16 we were using the following configuration:
With the update to 4.3.16 and on 4.4.x I receive the following error whenever I try to run Trying on 4.5.0 I see the new error:
I tried using the workaround mentioned above, like so, but I still get the same error.
Is there a different way to specify a dependency that should be used in place of this? Prior to 4.3.16 it was all working as expected. |
@kevinbarbour |
Any updates on this one? I'm also facing that issue with newer versions. |
|
We updated from 4.3.15 to 4.3.16 and now see this issue
You must add a pact publish configuration to your build before you can use the pactPublish task
Altough we have a pact publish configuration and it still works with 4.3.15.
We use Gradle 7.5.1
Does may this commit has something to do with it:
e3dd8bf?diff=split#diff-84994c4f13669c1feb65cf6db4a09398e94d9fef8d687329926cbd4547cb1370
Since 4.3.16 it seems like our pactPublish in this class is null
https://github.com/pact-foundation/pact-jvm/blob/master/provider/gradle/src/main/groovy/au/com/dius/pact/provider/gradle/PactPublishTask.groovy#L41
We don´t use Configuration cache as also Gradle says it is an incubating feature.
https://docs.gradle.org/current/userguide/configuration_cache.html
The text was updated successfully, but these errors were encountered: