From f11290c73d9804522585c1dc4a3e8554670af670 Mon Sep 17 00:00:00 2001 From: LamGC Date: Sun, 1 May 2022 23:09:44 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8F=AF=E4=BB=A5=E8=A6=86=E7=9B=96=20?= =?UTF-8?q?Maven=20=E4=B8=AD=E5=A4=AE=E4=BB=93=E5=BA=93=E9=85=8D=E7=BD=AE.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原本设计是无论配置文件中是否带有 Maven 中央仓库, 都会添加 Maven 中央仓库进去, 这样可能会覆盖用户的仓库配置. 新改动将检查配置中是否添加了 Maven 中央仓库配置来决定是否补充 Maven 中央仓库. --- scalabot-app/src/main/kotlin/AppMain.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scalabot-app/src/main/kotlin/AppMain.kt b/scalabot-app/src/main/kotlin/AppMain.kt index 36d5d42..674fa26 100644 --- a/scalabot-app/src/main/kotlin/AppMain.kt +++ b/scalabot-app/src/main/kotlin/AppMain.kt @@ -122,7 +122,12 @@ internal class Launcher : AutoCloseable { val remoteRepositories = Const.config.mavenRepositories .map(MavenRepositoryConfig::toRemoteRepository) .toMutableList().apply { - add(MavenRepositoryExtensionFinder.getMavenCentralRepository(proxy = Const.config.proxy.toAetherProxy())) + if (this.none { + it.url == MavenRepositoryExtensionFinder.MAVEN_CENTRAL_URL + || it.url == MavenRepositoryExtensionFinder.MAVEN_CENTRAL_URL.trimEnd('/') + }) { + add(MavenRepositoryExtensionFinder.getMavenCentralRepository(proxy = Const.config.proxy.toAetherProxy())) + } }.toList() val extensionPackageFinders = setOf( MavenRepositoryExtensionFinder(