-
Notifications
You must be signed in to change notification settings - Fork 29
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
Task ':publishXXX' uses this output of task ':signPluginMavenPublication' without declaring an explicit or implicit dependency - error in Gradle 8 #208
Comments
Could you provide a way to reproduce that situation (sample project, command, etc)? |
I assume you use the latest 1.3.0? |
|
Yes, it should be the same. However, we don't have a CI/CD in place, so there could be some local inconsistency :-/. However, what Gradle version do you use? I didn't see that error with Gradle 6.4.1 used in our e2e tests (as I just checked the version, it would be good to update it). Is it enough to call that task? Or you do any validation task? Please provide a way to reproduce the aforementioned warning (error?). |
I started to see it on 8.0.2 (probably 8+). It is happening with tons of plugins, not only this one. And it started to happen on all plugins on Gradle 8+. I am fixing it by myself in my DSL plugin (not tested yet) with val signingTasks: TaskCollection<Sign> = tasks.withType<Sign>()
tasks.withType<PublishToMavenRepository>().configureEach { task ->
task.mustRunAfter(signingTasks)
} But I am not sure if it is a good approach as |
For some reasons, I originally perceived it as "Java 8 compatibility"... That's why I asked about your Gradle version... |
…o patch Gradle 8 compatibility. For further details, see: gradle-nexus/publish-plugin#208
I've upgraded to latest (1.3.0) and the issue still persists, so I assume this is unresolved as of current. Any updates on this? |
I am also seeing
|
@JavierSegoviaCordoba I tried to reproduce the problem in compatibility tests with Wiremock, but without success. I even upgraded our e2e projects to Gradle 8.1.1 and they are still publishing fine (also the multimodule project in Kotlin). Have you by any chance been investigating what in the application causes the aforementioned error (or warning in 7.x)? Preferably, maybe you could modify this e2e project (or if a multimodule structure is required that one)? It would make it easier to fix it in the plugin itself. |
Unrelated to the above but also related to Gradle 8 compatibility (at least with Gradle 8.1.1): The It might make sense to introduce an alias to If I'm missing something obvious and there's a less hacky workaround please do let me know! I tried going over the Gradle release notes to check if this change in behaviour is mentioned anywhere but couldn't find anything to reference. I'd appreciate if someone could find a reference as to why this is now happening. Also, please let me know if you'd prefer that I create a new issue to track this. |
Regarding the original issue, I just attempted a publish with Gradle 8.1.1 and got the following error:
This is in a multi-module repository, the package in question is from a Kotlin multiplatform project. I'll compare it with your sample project to see if I can reproduce it there. |
@szpak, I didn't try to reproduce it with your example project, but I created a minimal reproduction with Kotlin multiplatform at: https://github.com/YarnSphere/nexus-publish-gradle-8 The issue appears when adding a Javadoc artifact to the publications and trying to sign them. In the example I create a Javadoc jar from Dokka's output and add it as an artifact to the publications. Running the Hope this helps! Let me know if you need something else. |
I'm facing the same issue from my entire projects: https://github.com/skydoves/sandwich/actions/runs/4769237431/jobs/8479418913 |
Regarding #208 (comment), where I say:
The less hacky workaround is simply: nexusPublishing {
this.repositories {
sonatype()
}
} Which I find acceptable (I don't know how I originally missed this 😅). |
…y you're accessing to address Gradle 8 compatibility. The `repositories` function is now clashing with `Project.repositories` from the Kotlin DSL. See: gradle-nexus/publish-plugin#208 (comment)
@YarnSphere Thanks for sharing your solution. But the plugin has a fundamental issue with gradle 8.0.
|
This plugin seems to work well with Gradle 8.0. |
Update: See here for the solution I found for the issue I encountered in this comment #208 (comment) regarding publishing my Android lib. Original comment
Update:
Removed this fix snippet because it was wrong and cut out my dependencies from the POM... oops. |
Thanks for the reproducer, however, it seems to not related with the GNPP. I commented out the whole
You should probably orchestrate the regular publishing with the signing. |
@skydoves Neither There was a real issue with deprecation in Gradle 8, but it was fixed in 1.2.0. |
I fixed my issues by adding a dependency like the one below:
|
Sorry for the delay in responding and thank you for looking into it, @szpak. I was under the misguided impression that GNPP provided the At least in regard to my reproduction, I agree with you in that this doesn't seem like GNPP's fault since the publishing tasks provided by GNPP fail in the same way that This still smells like a bug to me, though, I find it weird that we have to manually specify that a publishing task depends on the signing of its artifacts; this should, in my opinion, be implicit. Do you have any clue on which component would be responsible for this, in order to perhaps open a ticket in the correct repo? I'm not sure whether this would be an issue with the |
@YarnSphere I'm not sure, personally, I'm lagging behind the latest Gradle releases. Maybe it would be good to ask about that on the Gradle forum? |
Just wanted to drop an update to my previous comment in case it helps anyone (#208 (comment)). My project is Android and I encountered my issue which seemed similar. The previous fix I mentioned wasn't quite right, but this was the ultimate solution I found for my Android library project. I added this android {
...
publishing {
singleVariant("release")
}
} I found it here https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/dsl/Publishing and I think it might be related to the Android Gradle Plugin changes that coincided with Gradle 8 in this specific case https://developer.android.com/build/releases/gradle-plugin#8-0-0 Once this was added the publish script was able to locate |
Thanks @carlpoole for sharing your findings. Two general questions (anyone here, please reply, if you can answer YES, to any of those questions):
I'm not an Android developer, so I would like to know if this is something I should put to the README to help people dealing with similar issues. |
I have found it in KMP, but I don't remember if it has android too. |
The reproduction that I posted above that we concluded is not GNPP's fault (even though the issue still occurs when publishing via a GNPP task) is not an Android project. It is Kotlin multiplatform, but it doesn't even have an Android target. |
Right. So maybe multiple publishing variants is a key? @YarnSphere Could you test it with the latest Gradle 8.1.1 and maybe ask about that using the Gradle forum? |
Yeah, can do. I'll give it a try at reproducing it without Kotlin Multiplatform as well. |
It's worth noting as well, by the way, I don't think the Kotlin plugin officially supports Gradle 8 yet (https://kotlinlang.org/docs/whatsnew1820.html#gradle), so I wouldn't be surprised if this ends up being a problem with the Kotlin plugin. I'm curious if anyone here has managed to reproduce this in a non-Kotlin project, or at least in a non-Kotlin Multiplatform project. |
…bug workaround configuration resolves the jar signing issue.
Here is a reproducer where |
I investigated the problem further and I posted my findings here. It looks like a problem with the gradle signing plugin in combination with multiple publications which use the same input artifact. |
Thanks @Legion2. I've updated the original issue report to mention your analysis and a workaround (as it might be useful for the other affected users). |
I have checked that the plugin should be compatible with Gradle 8 but I found this issue.
Update XI 2023 (by the maintainer). The problem is not strictly related to this plugin and it seems to causes by the signing task with multiple publications. It is described by @Legion2 in this Gradle issue. There is also a workaround proposed, until it is fixed on the Gradle side.
The text was updated successfully, but these errors were encountered: