@@ -12,7 +12,7 @@ plugins {
1212 id ' maven-publish'
1313 id ' signing'
1414 id ' jacoco'
15- id ' io.github.gradle-nexus.publish-plugin' version " 2.0.0"
15+ id " io.github.gradle-nexus.publish-plugin" version " 2.0.0"
1616 id " com.diffplug.spotless" version " 6.13.0"
1717}
1818
@@ -159,33 +159,34 @@ publishing {
159159 }
160160 }
161161 }
162- repositories {
163- maven {
164- url " https://oss.sonatype.org/service/local/staging/deploy/maven2"
165- credentials {
166- username System . getenv(' OSSRH_USERNAME' )
167- password System . getenv(' OSSRH_PASSWORD' )
168- }
169- }
170- }
162+ // repositories {
163+ // maven {
164+ // url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
165+ // credentials {
166+ // username System.getenv('OSSRH_USERNAME')
167+ // password System.getenv('OSSRH_PASSWORD')
168+ // }
169+ // }
170+ // }
171171}
172172
173173nexusPublishing {
174- packageGroup = " com.meilisearch"
175-
176174 repositories {
177175 sonatype {
178- nexusUrl. set(uri(" https://oss.sonatype.org/service/local/" ))
179-
180- username = System . getenv(' OSSRH_USERNAME' )
181- password = System . getenv(' OSSRH_PASSWORD' )
182- stagingProfileId = System . getenv(' SONATYPE_STAGING_PROFILE_ID' )
176+ // Point to new Central Portal staging API (replaces oss.sonatype.org)
177+ nexusUrl. set(uri(" https://ossrh-staging-api.central.sonatype.com/service/local/" ))
178+ snapshotRepositoryUrl. set(uri(" https://central.sonatype.com/repository/maven-snapshots/" ))
179+ // Credentials: use Central Portal token (username/password)
180+ username. set(System . getenv(" MAVEN_CENTRAL_USERNAME" )) // portal token user
181+ password. set(System . getenv(" MAVEN_CENTRAL_PASSWORD" )) // portal token password
182+ // packageGroup or stagingProfileId not needed if using nexus-publish-plugin
183183 }
184184 }
185185}
186186
187187signing {
188- sign publishing. publications. mavenJava
188+ useInMemoryPgpKeys(System . getenv(" MAVEN_CENTRAL_SIGNING_KEY" ), System . getenv(" MAVEN_CENTRAL_SIGNING_PASSWORD" ))
189+ sign(publishing. publications[" mavenJava" ])
189190}
190191
191192javadoc {
0 commit comments