Skip to content

detekt-gradle-plugin has two publishing configuration #2996

@cortinico

Description

@cortinico

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions