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

deprecate old mavenPublish extension #340

Merged
merged 3 commits into from May 28, 2022
Merged

Conversation

gabrielittner
Copy link
Collaborator

This deprecates the old sonatypeHost and releaseSigningEnabled properties on the DSL. It also prepares for the following release to not add maven central as a default publishing target and not to enable release signing by default anymore.

Everyone currently publishing through maven central or signing releases without explicitly configuring it will get a warning. To get rid of the warning and prepare for the new behavior

SONATYPE_HOST=DEFAULT
RELEASE_SIGNING_ENABLED=true

(SONATYPE_HOST=S01 if s01.sonatype.org is used) needs to be added to the Gradle properties. Alternatively it's possible to use the new extension:

mavenPublishing {
    publishToMavenCentral("DEFAULT")
    signAllPublications()
}

Those 2 methods are now also not incubating anymore.

I've already updated the README because the properties are already fully supported.

@@ -30,6 +30,9 @@ uses Gradle properties. It's generally recommended to set them in your `gradle.p
file.

```properties
SONATYPE_HOST=DEFAULT
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't like that you have to specify this, why can't we do default always and only if you want to change it, you have to declare it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general there are 2 reasons for this

  • I think it's generally safer to not add something by default, this way you won't accidentally publish something internal by just running publish
  • From the plugin perspective we can avoid a lot of edge cases by having less afterEvaluate blocks, we won't be able to get rid of all of them (like when detecting which plugins are applied to the build) but at least some.

With properties we can still offer easy, low overhead configuration without the cost of afterEvaluate. If you want to publish to maven central you need to add the other properties anyways so it doesn't really increase the setup cost.

The reason for not using default as the value when no property is present is that it won't work well with the DSL. We would then call publishToMavenCentral(DEFAULT) immediately and users wouldn't be able to call publishToMavenCentral(S01) if the prefer to use the DSL over properties.

@@ -30,6 +30,9 @@ uses Gradle properties. It's generally recommended to set them in your `gradle.p
file.

```properties
SONATYPE_HOST=DEFAULT
RELEASE_SIGNING_ENABLED=true
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here as above

@gabrielittner gabrielittner merged commit c8dd40c into master May 28, 2022
@gabrielittner gabrielittner deleted the deprecate-old-extension branch May 28, 2022 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants