Skip to content
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

detekt-gradle-plugin has two publishing configuration #2996

Closed
cortinico opened this issue Aug 21, 2020 · 2 comments · Fixed by #3006
Closed

detekt-gradle-plugin has two publishing configuration #2996

cortinico opened this issue Aug 21, 2020 · 2 comments · Fixed by #3006
Milestone

Comments

@cortinico
Copy link
Member

On a related note - I've published my own fork in our local Artifactory which is configured strictly, i.e. it does not allow re-uploads of the same artifact version. When running the publish task on the detekt-gradle-plugin module, Gradle told me

Multiple publications with coordinates 'io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.12.0-RC1-android-gradle-plugin' are published to repository 'maven'. The publications will overwrite each other!

and the upload promptly failed because of that. I couldn't figure out myself what was different for this module with respect to the others, where no such warning is spit out and the initial upload works, I could only suspect that the com.gradle.plugin-publish plugin used in this module eventually adds another publishing configuration, but I don't know nearly enough about this plugin to verify that is true.

Originally posted by @realdadfish in #2995 (comment)

I couldn't figure out myself what was different for this module with respect to the others, where no such warning is spit out and the initial upload works, I could only suspect that the com.gradle.plugin-publish plugin used in this module eventually adds another publishing configuration, but I don't know nearly enough about this plugin to verify that is true.

I've done early investigation and that's exactly the case. The publish-plugin adds another configuration. Specifically:

$ ./gradlew detekt-gradle-plugin:tasks | grep ToBintrayRepository
publishAllPublicationsToBintrayRepository
publishDetektPluginPluginMarkerMavenPublicationToBintrayRepository <- Added by `publish-plugin`
publishDetektPublicationPublicationToBintrayRepository             <- Added by us (packaging)
publishPluginMavenPublicationToBintrayRepository.                  <- Added by `publish-plugin`

Specifically the last two publications have the same maven coordinates. We should make sure one of the two is excluded.

@arturbosch
Copy link
Member

arturbosch commented Aug 23, 2020

Actually I'm not sure if my PR breaks publishing to Gradle plugin portal itself xD but it deduplicates the publications.
Edit: well it shouldn't because pluginBundle has it own mavenCoordinates.

@cortinico
Copy link
Member Author

cortinico commented Aug 23, 2020

Actually I'm not sure if my PR breaks publishing to Gradle plugin portal itself xD

It shouldn't. I tried to publishPlugin and it failed with a 403 (that is expected):

> Task :detekt-gradle-plugin:publishPlugins FAILED
Publishing plugin io.gitlab.arturbosch.detekt version 1.12.0-RC1

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':detekt-gradle-plugin:publishPlugins'.
> Unauthorized!

If we see something wrong for the upcoming version release, we know what's the culprit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants