Codearte / gradle-nexus-staging-plugin

Automatize releasing Gradle projects to Maven Central.
Apache License 2.0
172 stars 26 forks source link

staginProfileId not honored #192

Closed lamba92 closed 3 years ago

lamba92 commented 3 years ago

In project kotlingram I am trying to publish a Kotlin/Multipaltform project that needs Windows, MacOs and Linux, and uses GitHub Actions to do so (see publication_ci.yml).

The Nexus Staging Plugin seems to not honor the repository name when creating one with task createRepository, instead naming the repository with comgithublamba92-{random_number} and ignoring the value stagingRepositoryId.set(rootProject.name) set in root build.gradle.kts.

I am also using the Nexus Publish Plugin which when executing gradlew publishToSonatype do not honor the repository id set by root staging plugin and instead generates a staging repository for each machine.

When invoking closeRepository it errors saying:

500: Server Error, body: [errors:[[id:*, msg:Unhandled: Missing staging repository: kotlingram]]]

Probably related to nexus-publish-plugin/#53

szpak commented 3 years ago

publishToSonatype and closeRepository (or closeAndReleaseRepository) has to be used in the same call to share stagingRepositoryId. GNSP + NPP don't support releasing from multiple builds and probably will not.

However, I and Marc (the author of NPP) wrote a brand new releasing plugin which also doesn't support it yet, but there is a plan to implement it one day :-). See https://github.com/gradle-nexus/publish-plugin/issues/59 (and https://github.com/gradle-nexus/publish-plugin/issues/19) to comment if it would be sufficient for you (once implemented).