From d4bb0331e44ba0153359adba7d95bc1f0a9bf2d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Dean=20K=C3=BCpper?= Date: Thu, 14 Mar 2024 23:04:03 +0100 Subject: [PATCH] use special nexus publish plugin --- build.gradle.kts | 21 +++++++++++++-------- gradle/libs.versions.toml | 1 + 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index e15d4ee..3a7ffbc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,7 @@ @file:Suppress("UnstableApiUsage") import com.google.protobuf.gradle.id +import org.gradle.internal.impldep.org.bouncycastle.cms.RecipientId.password import org.jlleitschuh.gradle.ktlint.reporter.ReporterType // define the gav coordinates of this project @@ -16,6 +17,7 @@ plugins { alias(libs.plugins.kotlin) alias(libs.plugins.dokka) alias(libs.plugins.kover) + alias(libs.plugins.nexusPublish) alias(libs.plugins.protobuf) alias(libs.plugins.sonarqube) alias(libs.plugins.ktlint) @@ -130,18 +132,21 @@ val dokkaJavadocJar = tasks.register("dokkaJavadocJar") { archiveClassifier.set("javadoc") } +nexusPublishing { + repositories { + sonatype { + nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) + snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) + username = System.getenv("OSSRH_USERNAME") + password = System.getenv("OSSRH_PASSWORD") + } + } +} + // configure the publishing in the maven repository publishing { // define the repositories that shall be used for publishing repositories { - maven { - name = "OSSRH" - url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") - credentials { - username = System.getenv("OSSRH_USERNAME") - password = System.getenv("OSSRH_PASSWORD") - } - } maven { name = "GitHubPackages" url = uri("https://maven.pkg.github.com/scrayosnet/xenos-client-kotlin") diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 96bab11..2496f4a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -43,3 +43,4 @@ kover = { id = "org.jetbrains.kotlinx.kover", version = "0.7.6" } protobuf = { id = "com.google.protobuf", version = "0.9.4" } sonarqube = { id = "org.sonarqube", version = "4.4.1.3373" } ktlint = { id = "org.jlleitschuh.gradle.ktlint", version = "12.1.0" } +nexusPublish = { id = "io.github.gradle-nexus.publish-plugin", version = "1.3.0" }