|
1 | 1 | plugins { |
| 2 | + id("com.gradleup.nmcp") version "0.0.8" |
2 | 3 | id("com.diffplug.spotless") version "6.25.0" apply false |
3 | 4 | } |
4 | 5 |
|
| 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 | + |
5 | 21 | allprojects { |
6 | 22 | group = "dev.arcp" |
7 | 23 | version = "1.0.0-SNAPSHOT" |
@@ -87,28 +103,8 @@ subprojects { |
87 | 103 | } |
88 | 104 | } |
89 | 105 | } |
90 | | - |
91 | | - // Sonatype Central. Credentials read from gradle.properties or |
92 | | - // ORG_GRADLE_PROJECT_* environment variables; the deploy target |
93 | | - // resolves to the OSS staging endpoint by default and to the |
94 | | - // snapshots repository when `version` carries the SNAPSHOT |
95 | | - // qualifier. |
96 | | - repositories { |
97 | | - maven { |
98 | | - name = "central" |
99 | | - val releases = uri( |
100 | | - "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") |
101 | | - val snapshots = uri( |
102 | | - "https://s01.oss.sonatype.org/content/repositories/snapshots/") |
103 | | - url = if (version.toString().endsWith("SNAPSHOT")) snapshots else releases |
104 | | - credentials { |
105 | | - username = (findProperty("ossrhUsername") as String?) |
106 | | - ?: System.getenv("OSSRH_USERNAME") ?: "" |
107 | | - password = (findProperty("ossrhPassword") as String?) |
108 | | - ?: System.getenv("OSSRH_PASSWORD") ?: "" |
109 | | - } |
110 | | - } |
111 | | - } |
| 106 | + // No maven repository block here — nmcp handles Central Portal |
| 107 | + // upload at the root project level. |
112 | 108 | } |
113 | 109 |
|
114 | 110 | // Signing is only wired when the developer has supplied a PGP key. |
|
0 commit comments