Skip to content

Commit 14854e5

Browse files
committed
fix(build.gradle): fix publication to maven central
1 parent 960c826 commit 14854e5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

buildSrc/src/main/kotlin/Publication.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,24 @@ fun Project.configurePublication() {
3333
maven {
3434
if (isRelease) {
3535
name = "centralPortal"
36-
setUrl("https://central.sonatype.com/api/v1/publisher/deployments/download/")
36+
setUrl("https://central.sonatype.com/api/v1/publisher/upload/")
3737
} else {
3838
name = "centralPortalSnapshots"
3939
println("Using SNAPSHOT repository")
4040
setUrl("https://central.sonatype.com/repository/maven-snapshots/")
4141
}
4242

4343
Publication.Repository.centralPortalToken?.let {
44-
authentication {
45-
create<HttpHeaderAuthentication>("header")
46-
}
44+
println("Central portal token found.")
4745

4846
credentials(HttpHeaderCredentials::class) {
4947
name = "Authorization"
5048
value = "Bearer $it"
5149
}
50+
51+
authentication {
52+
create<HttpHeaderAuthentication>("header")
53+
}
5254
} ?: println("No central portal token found. Skipping authentication.")
5355
}
5456
}

0 commit comments

Comments
 (0)