Skip to content

Commit ec48a61

Browse files
committed
Update publishing process after OSSRH was deprecated
1 parent 724cc19 commit ec48a61

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

RELEASING.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ CTRL-D
2525
gradle.publish.key=<secret>
2626
gradle.publish.secret=<secret>
2727
28-
ossrhUsername=javabrett
29-
ossrhPassword=<secret>
28+
mavenCentralTokenUsername=javabrett
29+
mavenCentralTokenPassword=<secret>
3030
3131
signing.gnupg.useLegacyGpg=true
3232
signing.gnupg.keyName=<secret>
@@ -44,7 +44,8 @@ signing.gnupg.keyName=<secret>
4444
./gradlew publishMavenJavaPublicationToMavenRepository
4545
```
4646

47-
... then visit https://oss.sonatype.org/ to review uploads and approve/promote/release.
47+
Run the two needed requests explained [here](https://central.sonatype.org/publish/publish-portal-ossrh-staging-api/#2-make-separate-requests).
48+
Then visit https://central.sonatype.com/publishing to review uploads and hit `Publish`.
4849

4950
Wait until the new version is available at `https://repo1.maven.org/maven2/org/gretty/gretty/x.x.x/` (takes a while - maybe half an hour - and note the last `/` - it's important!).
5051

buildSrc/src/main/groovy/grettybuild.common.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ artifacts {
132132
archives javadocJar, sourcesJar
133133
}
134134

135-
if (hasProperty('ossrhUsername') && hasProperty('ossrhPassword')) {
135+
if (hasProperty('mavenCentralTokenUsername') && hasProperty('mavenCentralTokenPassword')) {
136136
afterEvaluate {
137137
tasks.named('publishMavenJavaPublicationToMavenRepository').configure {
138138
dependsOn assertJDKVersion
@@ -142,12 +142,12 @@ if (hasProperty('ossrhUsername') && hasProperty('ossrhPassword')) {
142142
publishing {
143143
repositories {
144144
maven {
145-
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
146-
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
145+
def releasesRepoUrl = 'https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/'
146+
def snapshotsRepoUrl = 'https://central.sonatype.com/repository/maven-snapshots/'
147147
url = project.version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
148148
credentials {
149-
username = ossrhUsername
150-
password = ossrhPassword
149+
username = mavenCentralTokenUsername
150+
password = mavenCentralTokenPassword
151151
}
152152
}
153153
}

0 commit comments

Comments
 (0)