From 98d0009f1c3b1b68ab3328d6eac6aab55e878a51 Mon Sep 17 00:00:00 2001 From: Luis Date: Fri, 30 Aug 2024 20:41:55 +0100 Subject: [PATCH] fix: why is publishing to maven central so difficult? --- api/build.gradle | 5 ----- build.gradle | 12 ++++++++++++ common/build.gradle | 5 ----- minestom/build.gradle | 5 ----- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/api/build.gradle b/api/build.gradle index 3f5845e84..7e73d8137 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -117,11 +117,6 @@ publishing { url = 'https://repo.hypera.dev/snapshots/' credentials(PasswordCredentials) } - maven { - name = 'sonatype' - url = 'https://s01.oss.sonatype.org/content/repositories/snapshots/' - credentials(PasswordCredentials) - } } publications { diff --git a/build.gradle b/build.gradle index 7b6048465..c354dac86 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,6 @@ plugins { alias(libs.plugins.licenser) apply false + id("io.github.gradle-nexus.publish-plugin") version "2.0.0" } import org.gradle.api.tasks.testing.logging.TestExceptionFormat @@ -85,3 +86,14 @@ subprojects { maven { url 'https://libraries.minecraft.net/' } } } + +nexusPublishing { + useStaging.set(true) + + repositories { + sonatype { //only for users registered in Sonatype after 24 Feb 2021 + nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) + snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) + } + } +} diff --git a/common/build.gradle b/common/build.gradle index 6c84bf3de..a1f11d2a1 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -108,11 +108,6 @@ publishing { url = 'https://repo.hypera.dev/snapshots/' credentials(PasswordCredentials) } - maven { - name = 'sonatype' - url = 'https://s01.oss.sonatype.org/content/repositories/snapshots/' - credentials(PasswordCredentials) - } } publications { diff --git a/minestom/build.gradle b/minestom/build.gradle index 88aefcad7..8be225c2e 100644 --- a/minestom/build.gradle +++ b/minestom/build.gradle @@ -52,11 +52,6 @@ publishing { url = 'https://repo.hypera.dev/snapshots/' credentials(PasswordCredentials) } - maven { - name = 'sonatype' - url = 'https://s01.oss.sonatype.org/content/repositories/snapshots/' - credentials(PasswordCredentials) - } } publications {