From 563a93e6d95634e410e46c40afd516019d0ed27c Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Mar 2026 05:35:07 +0000 Subject: [PATCH] Fix snapshot publishing auth: use basic auth instead of Bearer token The Central Portal snapshot repository (maven-snapshots) uses standard basic authentication (username/password), not Bearer token auth. Bearer is for the Portal API and OSSRH Staging API, but the snapshot repo is a standard Maven repository. https://claude.ai/code/session_0185eQCsjR2uRsGWn2JpU9Xr --- build.gradle.kts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 869aa7f..a5845f7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,5 @@ import org.jetbrains.dokka.gradle.engine.parameters.VisibilityModifier import java.net.URL -import java.util.Base64 plugins { kotlin("jvm") @@ -117,14 +116,9 @@ publishing { maven { name = "centralPortalSnapshots" url = uri("https://central.sonatype.com/repository/maven-snapshots/") - credentials(HttpHeaderCredentials::class) { - name = "Authorization" - val token = "$sonatypeUsername:$sonatypePassword" - value = - "Bearer ${Base64.getEncoder().encodeToString(token.toByteArray())}" - } - authentication { - create("header") + credentials { + username = sonatypeUsername + password = sonatypePassword } } }