Skip to content

Commit d9ea77d

Browse files
committed
fix: migrate to nmcp 1.5.0 settings plugin for Maven Central publishing
The 0.0.8 project-level plugin's publishAllProjectsProbablyBreakingProjectIsolation {} does not see publications registered inside afterEvaluate blocks, so the aggregation task was never created and the release workflow failed with: Task 'publishAllPublicationsToMavenCentral' not found Switch to the 1.5.0 settings-plugin approach (com.gradleup.nmcp.settings), which aggregates all subproject publications correctly regardless of when they are wired. The publish task becomes publishAggregationToCentralPortal.
1 parent 249c01f commit d9ea77d

3 files changed

Lines changed: 13 additions & 19 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
CENTRAL_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
5555
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_SIGNING_KEY }}
5656
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_SIGNING_PASSWORD }}
57-
run: ./gradlew --no-daemon --stacktrace publishAllPublicationsToMavenCentral
57+
run: ./gradlew --no-daemon --stacktrace publishAggregationToCentralPortal
5858

5959
- name: Local publish (dry run)
6060
if: ${{ inputs.dry_run }}

build.gradle.kts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,7 @@
11
plugins {
2-
id("com.gradleup.nmcp") version "0.0.8"
32
id("com.diffplug.spotless") version "6.25.0" apply false
43
}
54

6-
// Publish all subproject maven-publish publications to Maven Central via the
7-
// Central Publisher Portal REST API (replaces the retired s01.oss.sonatype.org
8-
// OSSRH staging endpoint). Credentials are read from CENTRAL_USERNAME /
9-
// CENTRAL_PASSWORD environment variables (or the corresponding Gradle
10-
// properties). publicationType = "AUTOMATIC" auto-releases after upload.
11-
nmcp {
12-
publishAllProjectsProbablyBreakingProjectIsolation {
13-
username = (findProperty("centralUsername") as String?)?.ifBlank { null }
14-
?: System.getenv("CENTRAL_USERNAME")?.ifBlank { null } ?: ""
15-
password = (findProperty("centralPassword") as String?)?.ifBlank { null }
16-
?: System.getenv("CENTRAL_PASSWORD")?.ifBlank { null } ?: ""
17-
publicationType = "AUTOMATIC"
18-
}
19-
}
20-
215
allprojects {
226
group = "dev.arcp"
237
version = "1.0.0-SNAPSHOT"
@@ -103,8 +87,6 @@ subprojects {
10387
}
10488
}
10589
}
106-
// No maven repository block here — nmcp handles Central Portal
107-
// upload at the root project level.
10890
}
10991

11092
// Signing is only wired when the developer has supplied a PGP key.

settings.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
plugins {
2+
id("com.gradleup.nmcp.settings") version "1.5.0"
3+
}
4+
5+
nmcpSettings {
6+
centralPortal {
7+
username = System.getenv("CENTRAL_USERNAME")?.ifBlank { null } ?: ""
8+
password = System.getenv("CENTRAL_PASSWORD")?.ifBlank { null } ?: ""
9+
publishingType = "AUTOMATIC"
10+
}
11+
}
12+
113
rootProject.name = "arcp"
214

315
include(

0 commit comments

Comments
 (0)