fix: 修正方法参数使用错误的问题.

MavenRepositoryConfig 的 toRemoteRepository 方法使用了参数默认值, 可能会导致意外使用常量的情况,
故移除 MavenRepositoryConfig.toRemoteRepository 的参数默认值.

Pull Request #6
This commit is contained in:
LamGC 2022-05-04 23:05:49 +08:00
parent d24572a4f3
commit ce613787f6
Signed by: LamGC
GPG Key ID: 6C5AE2A913941E1D
2 changed files with 2 additions and 2 deletions

View File

@ -106,7 +106,7 @@ internal data class MavenRepositoryConfig(
val authentication: Authentication? = null
) {
fun toRemoteRepository(proxyConfig: ProxyConfig = Const.config.proxy): RemoteRepository {
fun toRemoteRepository(proxyConfig: ProxyConfig): RemoteRepository {
val builder = RemoteRepository.Builder(null, checkRepositoryLayout(layout), url.toString())
if (proxy != null) {
builder.setProxy(proxy)

View File

@ -123,7 +123,7 @@ internal class Launcher(private val config: AppConfig = Const.config) : AutoClos
val account = botConfig.account
val remoteRepositories = config.mavenRepositories
.map(MavenRepositoryConfig::toRemoteRepository)
.map { it.toRemoteRepository(config.proxy) }
.toMutableList().apply {
if (this.none {
it.url == MavenRepositoryExtensionFinder.MAVEN_CENTRAL_URL