diff --git a/build.gradle.kts b/build.gradle.kts index 52ca889..b86aa83 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,7 +10,6 @@ buildscript { } dependencies { classpath("com.google.protobuf:protobuf-gradle-plugin:0.8.19") - classpath("io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.30.0") classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.9.20") } } @@ -29,6 +28,7 @@ plugins { id("io.codearte.nexus-staging") version "0.30.0" id("com.google.protobuf") version "0.8.19" id("com.diffplug.spotless") version "6.21.0" + id("io.github.gradle-nexus.publish-plugin") version "2.0.0" } java { @@ -147,10 +147,19 @@ tasks.test { useJUnitPlatform() } -nexusStaging { - serverUrl = "https://s01.oss.sonatype.org/service/local/" - packageGroup = properties["GROUP"] as String - stagingProfileId = "16b57cbf143daa" +group = properties["GROUP"].toString() +version = properties["VERSION_NAME"].toString() + +nexusPublishing { + repositories { + sonatype { + //only for users registered in Sonatype after 24 Feb 2021 + username.set(properties["nexusUsername"].toString()) + password.set(properties["nexusPassword"].toString()) + nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/")) + snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/")) + } + } } publishing { diff --git a/gradle.properties b/gradle.properties index 362a9e5..74180ab 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,8 +22,8 @@ POM_LICENCE_DIST=repo POM_DEVELOPER_ID=livekit POM_DEVELOPER_NAME=LiveKit -RELEASE_REPOSITORY_URL=https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ -SNAPSHOT_REPOSITORY_URL=https://s01.oss.sonatype.org/content/repositories/snapshots/ +RELEASE_REPOSITORY_URL=https://ossrh-staging-api.central.sonatype.com/service/local/ +SNAPSHOT_REPOSITORY_URL=https://central.sonatype.com/repository/maven-snapshots/ # Variables required to allow build.gradle to parse for publishing. # WARNING: Do not edit this and potentially commit to repo. diff --git a/gradle/gradle-mvn-push.gradle b/gradle/gradle-mvn-push.gradle index 63aa3a0..50ef1f7 100644 --- a/gradle/gradle-mvn-push.gradle +++ b/gradle/gradle-mvn-push.gradle @@ -31,12 +31,12 @@ def isReleaseBuild() { def getReleaseRepositoryUrl() { return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL - : "https://oss.sonatype.org/service/local/staging/deploy/maven2/" + : "https://ossrh-staging-api.central.sonatype.com/service/local/" } def getSnapshotRepositoryUrl() { return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL - : "https://oss.sonatype.org/content/repositories/snapshots/" + : "https://central.sonatype.com/repository/maven-snapshots/" } def getRepositoryUsername() {