Skip to content

Commit bcd1895

Browse files
authored
Merge pull request #12 from contentpass/CHORE-switch-sonatype-central
Switch to Sonatype Central
2 parents 9345c8b + 24cfc03 commit bcd1895

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ buildscript {
1818
}
1919

2020
plugins {
21-
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
21+
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
2222
id("org.jetbrains.dokka") version "1.5.30"
2323
}
2424

scripts/publish-root.gradle

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
ext["signing.keyId"] = ''
33
ext["signing.password"] = ''
44
ext["signing.key"] = ''
5-
ext["ossrhUsername"] = ''
6-
ext["ossrhPassword"] = ''
5+
ext["centralUsername"] = ''
6+
ext["centralPassword"] = ''
77
ext["sonatypeStagingProfileId"] = ''
88

99
File secretPropsFile = project.rootProject.file('local.properties')
@@ -15,24 +15,26 @@ if (secretPropsFile.exists()) {
1515
p.each { name, value -> ext[name] = value }
1616
} else {
1717
// Use system environment variables
18-
ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME')
19-
ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD')
18+
// For Central Portal, use token as password (username is your Sonatype account username)
19+
ext["centralUsername"] = System.getenv('CENTRAL_USERNAME') ?: System.getenv('OSSRH_USERNAME')
20+
ext["centralPassword"] = System.getenv('CENTRAL_PASSWORD') ?: System.getenv('OSSRH_PASSWORD')
2021
ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID')
2122
ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID')
2223
ext["signing.password"] = System.getenv('SIGNING_PASSWORD')
2324
ext["signing.key"] = System.getenv('SIGNING_KEY')
2425
}
2526

26-
// Set up Sonatype repository
27+
// Set up Central Portal repository
2728
nexusPublishing {
2829
repositories {
2930
sonatype {
3031
stagingProfileId = sonatypeStagingProfileId
31-
username = ossrhUsername
32-
password = ossrhPassword
32+
username = centralUsername
33+
password = centralPassword
3334

34-
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
35-
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
35+
// Central Portal endpoints
36+
nexusUrl.set(uri("https://central.sonatype.com/"))
37+
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/content/repositories/snapshots/"))
3638
}
3739
}
3840
}

0 commit comments

Comments
 (0)