Skip to content

Commit 4e9c683

Browse files
committed
Migrate to Central Portal OSSRH Staging API
1 parent 0ba642f commit 4e9c683

4 files changed

Lines changed: 56 additions & 21 deletions

File tree

.github/workflows/gradle.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,11 @@ jobs:
5959
env:
6060
SECRING_FILE: ${{ secrets.SECRING_FILE }}
6161
run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg
62-
- name: Publish to Sonatype OSSRH
62+
- name: Publish to Maven Central Portal
6363
id: publish
6464
env:
65-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
66-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
67-
SONATYPE_NEXUS_URL: ${{ secrets.SONATYPE_NEXUS_URL }}
68-
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
65+
MAVEN_CENTRAL_USER: ${{ secrets.MAVEN_CENTRAL_USER }}
66+
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
6967
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
7068
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
7169
SECRING_FILE: ${{ secrets.SECRING_FILE }}

.github/workflows/release.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,12 @@ jobs:
7070
env:
7171
SECRING_FILE: ${{ secrets.SECRING_FILE }}
7272
run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg
73-
- name: Publish to Sonatype OSSRH
73+
- name: Publish to Maven Central Portal
7474
id: publish
7575
if: steps.secring.outcome == 'success'
7676
env:
77-
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
78-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
79-
SONATYPE_NEXUS_URL: ${{ secrets.SONATYPE_NEXUS_URL }}
80-
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
77+
MAVEN_CENTRAL_USER: ${{ secrets.MAVEN_CENTRAL_USER }}
78+
MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
8179
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
8280
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
8381
SECRING_FILE: ${{ secrets.SECRING_FILE }}

build.gradle

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,19 @@ buildscript {
22
repositories {
33
// mavenLocal()
44
mavenCentral()
5-
// maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" }
65
maven { url "https://repo.gradle.org/gradle/libs-releases" }
76
maven { url "https://plugins.gradle.org/m2/" }
7+
maven {
8+
name = 'Maven Central Portal Snapshots'
9+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
10+
11+
content {
12+
includeGroup 'org.graceframework.plugins'
13+
}
14+
mavenContent {
15+
snapshotsOnly()
16+
}
17+
}
818
}
919
dependencies {
1020
classpath "io.github.gradle-nexus:publish-plugin:2.0.0"
@@ -31,7 +41,17 @@ apply from: 'gradle/docs.gradle'
3141
repositories {
3242
// mavenLocal()
3343
mavenCentral()
34-
// maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" }
44+
maven {
45+
name = 'Maven Central Portal Snapshots'
46+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
47+
48+
content {
49+
includeGroup 'org.graceframework.plugins'
50+
}
51+
mavenContent {
52+
snapshotsOnly()
53+
}
54+
}
3555
}
3656

3757
configurations {
@@ -140,14 +160,12 @@ tasks.withType(Test) {
140160
nexusPublishing {
141161
repositories {
142162
sonatype {
143-
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : ''
144-
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : ''
145-
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.hasProperty("sonatypeOssStagingProfileId") ? project.sonatypeOssStagingProfileId : ''
146-
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
147-
snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
148-
username = ossUser
149-
password = ossPass
150-
stagingProfileId = ossStagingProfileId
163+
def mavenUser = System.getenv("MAVEN_CENTRAL_USER") ?: project.hasProperty("mavenCentralUsername") ? project.mavenCentralUsername : ''
164+
def mavenPass = System.getenv("MAVEN_CENTRAL_PASSWORD") ?: project.hasProperty("mavenCentralPassword") ? project.mavenCentralPassword : ''
165+
nexusUrl = uri("https://ossrh-staging-api.central.sonatype.com/service/local/")
166+
snapshotRepositoryUrl = uri("https://central.sonatype.com/repository/maven-snapshots/")
167+
username = mavenUser
168+
password = mavenPass
151169
}
152170
}
153171
}

plugin/build.gradle

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,19 @@ buildscript {
22
repositories {
33
// mavenLocal()
44
mavenCentral()
5-
// maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" }
65
maven { url "https://repo.gradle.org/gradle/libs-releases" }
76
maven { url "https://plugins.gradle.org/m2/" }
7+
maven {
8+
name = 'Maven Central Portal Snapshots'
9+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
10+
11+
content {
12+
includeGroup 'org.graceframework.plugins'
13+
}
14+
mavenContent {
15+
snapshotsOnly()
16+
}
17+
}
818
}
919
}
1020

@@ -26,6 +36,17 @@ apply plugin: "signing"
2636
repositories {
2737
// mavenLocal()
2838
mavenCentral()
39+
maven {
40+
name = 'Maven Central Portal Snapshots'
41+
url = 'https://central.sonatype.com/repository/maven-snapshots/'
42+
43+
content {
44+
includeGroup 'org.graceframework.plugins'
45+
}
46+
mavenContent {
47+
snapshotsOnly()
48+
}
49+
}
2950
}
3051

3152
dependencies {

0 commit comments

Comments
 (0)