From a44732a7f6daff178cb5e39349507b9c28072184 Mon Sep 17 00:00:00 2001 From: LamGC Date: Tue, 17 May 2022 19:03:58 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E5=B0=86=20Maven=20=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E4=BB=93=E5=BA=93=E4=BB=8E=20Github=20Repo=20=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E8=87=AA=E5=BB=BA=20Nexus=20=E4=BB=93=E5=BA=93.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 由于 Github 自建仓库在 SNAPSHOT 版本上存在问题, 故修改发布配置以转移到自建的 Nexus 仓库. --- scalabot-extension/build.gradle.kts | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/scalabot-extension/build.gradle.kts b/scalabot-extension/build.gradle.kts index 5571593..e3ca005 100644 --- a/scalabot-extension/build.gradle.kts +++ b/scalabot-extension/build.gradle.kts @@ -38,24 +38,21 @@ tasks.withType { publishing { repositories { - val repoRootKey = "maven.repo.local.root" - val snapshot = project.version.toString().endsWith("-SNAPSHOT") - val repoRoot = System.getProperty(repoRootKey)?.trim() - if (repoRoot == null || repoRoot.isEmpty()) { - logger.warn( - "\"$repoRootKey\" configuration item is not specified, " + - "please add start parameter \"-D$repoRootKey {localPublishRepo}\"" + - " (if you are not currently executing the publish task, " + - "you can ignore this information)" - ) - return@repositories - } - val repoUri = if (snapshot) { - uri("$repoRoot/snapshots") + if (project.version.toString().endsWith("-SNAPSHOT")) { + maven("https://repo.lamgc.moe/repository/maven-snapshots/") { + credentials { + username = project.properties["repo.credentials.private.username"].toString() + password = project.properties["repo.credentials.private.password"].toString() + } + } } else { - uri("$repoRoot/releases") + maven("https://repo.lamgc.moe/repository/maven-releases/") { + credentials { + username = project.properties["repo.credentials.private.username"].toString() + password = project.properties["repo.credentials.private.password"].toString() + } + } } - maven(repoUri) } publications {