From 4537e081076ca74cd06ad96e50efcb4000530aea Mon Sep 17 00:00:00 2001 From: LamGC Date: Wed, 2 Aug 2023 17:41:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(config):=20=E5=B0=86=20local=20=E5=88=97?= =?UTF-8?q?=E4=B8=BA=20Maven=20=E4=BB=93=E5=BA=93=20Id=20=E7=9A=84?= =?UTF-8?q?=E4=BF=9D=E7=95=99=E5=AD=97.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit local 是 Aether 中代表 LocalRepository 的仓库 Id, 因此拒绝用户使用 local 作为远端仓库的 Id. --- scalabot-app/src/main/kotlin/AppConfigs.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scalabot-app/src/main/kotlin/AppConfigs.kt b/scalabot-app/src/main/kotlin/AppConfigs.kt index 51f54ab..0072141 100644 --- a/scalabot-app/src/main/kotlin/AppConfigs.kt +++ b/scalabot-app/src/main/kotlin/AppConfigs.kt @@ -48,6 +48,10 @@ internal fun MavenRepositoryConfig.toRemoteRepository(proxyConfig: ProxyConfig? val generatedRepoId = createDefaultRepositoryId() log.debug { "仓库 Url `$url` 未设置仓库 Id, 已分配缺省 Id: $generatedRepoId" } generatedRepoId + } else if ("local".contentEquals(id, ignoreCase = true)) { + val generatedRepoId = createDefaultRepositoryId() + log.debug { "仓库 Url `$url` 不允许使用 `local` 作为仓库 Id, 已分配缺省 Id: $generatedRepoId" } + generatedRepoId } else { id }