mirror of
https://github.com/LamGC/ScalaBot.git
synced 2025-12-19 08:30:44 +00:00
feat(config): 支持限定 Maven 仓库构件类型.
增加 Maven 仓库配置, 支持限定仓库可获取的构件发布类型(发布或快照). 此改动有利于用户增加仓库约束, 防止意外使用错误的扩展包版本.
This commit is contained in:
@ -142,12 +142,15 @@ internal object MavenRepositoryConfigSerializer
|
||||
return when (json) {
|
||||
is JsonObject -> {
|
||||
MavenRepositoryConfig(
|
||||
id = json.get("id")?.asString,
|
||||
url = URL(checkJsonKey(json, "url")),
|
||||
proxy = if (json.has("proxy") && json.get("proxy").isJsonObject)
|
||||
context.deserialize<Proxy>(
|
||||
json.getAsJsonObject("proxy"), Proxy::class.java
|
||||
) else null,
|
||||
layout = json.get("layout").asString ?: "default",
|
||||
enableReleases = json.get("enableReleases")?.asBoolean ?: true,
|
||||
enableSnapshots = json.get("enableSnapshots")?.asBoolean ?: true,
|
||||
authentication = if (json.has("authentication") && json.get("authentication").isJsonObject)
|
||||
context.deserialize<Authentication>(
|
||||
json.getAsJsonObject("authentication"), Authentication::class.java
|
||||
|
||||
Reference in New Issue
Block a user