From 425e779c2c3dd4ff3f49b0c3f1cddd46f33b8923 Mon Sep 17 00:00:00 2001 From: Gabriel Ittner Date: Thu, 19 Sep 2024 19:44:46 +0200 Subject: [PATCH] support custom Sonatype hosts through Gradle property --- .../kotlin/com/vanniktech/maven/publish/SonatypeHost.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin/src/main/kotlin/com/vanniktech/maven/publish/SonatypeHost.kt b/plugin/src/main/kotlin/com/vanniktech/maven/publish/SonatypeHost.kt index ed0bf1e1..aa1466ac 100644 --- a/plugin/src/main/kotlin/com/vanniktech/maven/publish/SonatypeHost.kt +++ b/plugin/src/main/kotlin/com/vanniktech/maven/publish/SonatypeHost.kt @@ -29,7 +29,11 @@ data class SonatypeHost internal constructor( "DEFAULT" -> DEFAULT "S01" -> S01 "CENTRAL_PORTAL" -> CENTRAL_PORTAL - else -> throw IllegalArgumentException("No SonatypeHost constant $sonatypeHost") + else -> if (sonatypeHost.startsWith("https://")) { + SonatypeHost(sonatypeHost) + } else { + throw IllegalArgumentException("No SonatypeHost constant $sonatypeHost") + } } @JvmField