@@ -18,7 +18,7 @@ plugins {
1818 kotlin(" plugin.serialization" ) version " 1.8.0"
1919
2020 id(" com.android.library" ) version " 7.4.0"
21- id(" io.codearte. nexus-staging " ) version " 0.30 .0"
21+ id(" io.github.gradle- nexus.publish-plugin " ) version " 1.1 .0"
2222 id(" com.dorongold.task-tree" ) version " 2.1.1"
2323 id(" com.codingfeline.buildkonfig" ) version " 0.13.3"
2424 id(" dev.zxilly.gradle.keeper" ) version " 0.0.5"
@@ -176,23 +176,22 @@ android {
176176
177177val mavenCentralUser = secret.get(" maven.user" )
178178val mavenCentralPassword = secret.get(" maven.password" )
179- val releasesRepoUrl = uri(" https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" )
180- val snapshotsRepoUrl = uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" )
181-
182- val mavenCentralReleaseUrl =
183- if (version.toString().endsWith(" SNAPSHOT" )) snapshotsRepoUrl else releasesRepoUrl
184179
185180val githubUser = secret.get(" github.user" )
186181val githubToken = secret.get(" github.token" )
187182
188183val githubPackageRegistryUrl = uri(" https://maven.pkg.github.com/ZNotify/kt-sdk" )
189184
190- nexusStaging {
191- serverUrl = " https://s01.oss.sonatype.org/service/local/"
192- username = mavenCentralUser
193- password = mavenCentralPassword
194- packageGroup = " dev.zxilly"
195- stagingProfileId = " 95214448af0738"
185+ nexusPublishing {
186+ repositories {
187+ sonatype {
188+ nexusUrl.set(uri(" https://s01.oss.sonatype.org/service/local/" ))
189+ snapshotRepositoryUrl.set(uri(" https://s01.oss.sonatype.org/content/repositories/snapshots/" ))
190+ username.set(mavenCentralUser)
191+ password.set(mavenCentralPassword)
192+ packageGroup.set(" dev.zxilly" )
193+ }
194+ }
196195}
197196
198197val javadocJar by tasks.registering(Jar ::class ) {
@@ -201,14 +200,6 @@ val javadocJar by tasks.registering(Jar::class) {
201200
202201publishing {
203202 repositories {
204- maven {
205- name = " sonatype"
206- url = mavenCentralReleaseUrl
207- credentials {
208- username = mavenCentralUser
209- password = mavenCentralPassword
210- }
211- }
212203 maven {
213204 name = " github"
214205 url = githubPackageRegistryUrl
0 commit comments