feat: 可以覆盖 Maven 中央仓库配置.

原本设计是无论配置文件中是否带有 Maven 中央仓库, 都会添加 Maven 中央仓库进去, 这样可能会覆盖用户的仓库配置.
新改动将检查配置中是否添加了 Maven 中央仓库配置来决定是否补充 Maven 中央仓库.
This commit is contained in:
LamGC 2022-05-01 23:09:44 +08:00
parent 1f2ab0f9b1
commit f11290c73d
Signed by: LamGC
GPG Key ID: 6C5AE2A913941E1D

View File

@ -122,7 +122,12 @@ internal class Launcher : AutoCloseable {
val remoteRepositories = Const.config.mavenRepositories val remoteRepositories = Const.config.mavenRepositories
.map(MavenRepositoryConfig::toRemoteRepository) .map(MavenRepositoryConfig::toRemoteRepository)
.toMutableList().apply { .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() }.toList()
val extensionPackageFinders = setOf( val extensionPackageFinders = setOf(
MavenRepositoryExtensionFinder( MavenRepositoryExtensionFinder(