From a154fcc3062ede2afeb88966d12111fff08c56be Mon Sep 17 00:00:00 2001 From: Jocelyne <38375996+joc-a@users.noreply.github.com> Date: Wed, 21 Jun 2023 15:58:20 +0200 Subject: [PATCH] chore: Set up Maven publishing (#1761) * chore: Set up Maven publishing * chore: Remove nexusPublishing --- build.gradle.kts | 10 ---------- buildScripts/gradle/publishing.gradle.kts | 22 ++++++++++++++++++++-- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index a6706ab287..e5bf76e940 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -45,16 +45,6 @@ subprojects { } } -nexusPublishing { - repositories { - sonatype { - username.set(System.getenv("exposed.sonatype.user")) - password.set(System.getenv("exposed.sonatype.password")) - useStaging.set(true) - } - } -} - repositories { mavenLocal() mavenCentral() diff --git a/buildScripts/gradle/publishing.gradle.kts b/buildScripts/gradle/publishing.gradle.kts index 5013e67558..ed3390689e 100644 --- a/buildScripts/gradle/publishing.gradle.kts +++ b/buildScripts/gradle/publishing.gradle.kts @@ -9,15 +9,33 @@ _java { withSourcesJar() } +val version: String by rootProject + _publishing { publications { - create("ExposedJars") { + create("exposed") { + groupId = "org.jetbrains.exposed" artifactId = project.name - from(project.components["java"]) + version = version + from(components["java"]) pom { configureMavenCentralMetadata(project) } signPublicationIfKeyPresent(project) } } + + val publishingUsername: String? = System.getenv("PUBLISHING_USERNAME") + val publishingPassword: String? = System.getenv("PUBLISHING_PASSWORD") + + repositories { + maven { + name = "Exposed" + url = uri("https://maven.pkg.jetbrains.space/public/p/exposed/release") + credentials { + username = publishingUsername + password = publishingPassword + } + } + } }