From 3d5a009c7c9ee9a30a9ba6985f2c464f990127b3 Mon Sep 17 00:00:00 2001 From: LamGC Date: Mon, 21 Feb 2022 15:42:07 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E8=AE=BE=E7=BD=AE=E4=BA=86=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E5=B0=8F=E4=BB=93=E5=BA=93=E7=9A=84=E9=85=8D=E7=BD=AE?= =?UTF-8?q?.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 目前处于 alpha 版本, 所以构建就不发到 Maven 中央仓库了. 如需使用, 可以看 https://github.com/LamGC/maven-repository 获取引用方式. --- scalabot-extension/build.gradle.kts | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/scalabot-extension/build.gradle.kts b/scalabot-extension/build.gradle.kts index 7dade8b..4e91eca 100644 --- a/scalabot-extension/build.gradle.kts +++ b/scalabot-extension/build.gradle.kts @@ -35,12 +35,24 @@ tasks.withType { publishing { repositories { - maven { - credentials { - - } - url = uri("") + 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") + } else { + uri("$repoRoot/releases") + } + maven(repoUri) } publications { @@ -63,14 +75,14 @@ publishing { developers { developer { id.set("LamGC") - name.set("Lam GC") + name.set("LamGC") email.set("lam827@lamgc.net") url.set("https://github.com/LamGC") } } scm { connection.set("scm:git:https://github.com/LamGC/ScalaBot.git") - developerConnection.set("scm:git:ssh://git@github.com:LamGC/ScalaBot.git") + developerConnection.set("scm:git:https://github.com/LamGC/ScalaBot.git") url.set("https://github.com/LamGC/ScalaBot") } issueManagement {