feat(config): 支持限定 Maven 仓库构件类型.

增加 Maven 仓库配置, 支持限定仓库可获取的构件发布类型(发布或快照).
此改动有利于用户增加仓库约束, 防止意外使用错误的扩展包版本.
This commit is contained in:
2022-05-18 15:57:49 +08:00
parent 0a5313e94a
commit 5e18149640
2 changed files with 7 additions and 2 deletions

View File

@ -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