Skip to content

Commit d510441

Browse files
committed
prepare release to Central
1 parent fe23841 commit d510441

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

build.gradle.kts

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -165,23 +165,30 @@ publishing {
165165
}
166166
}
167167
repositories {
168-
// To locally check out the poms
169-
maven {
170-
name = "BuildDir"
171-
url = uri("$buildDir/repos/snapshots")
172-
}
173-
// Snapshots are published to Sonatype's repository directly
174-
maven {
175-
name = "SonatypeOSS"
176-
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
177-
credentials {
178-
val ossrhUsername: String by project
179-
val ossrhPassword: String by project
180-
username = ossrhUsername
181-
password = ossrhPassword
182-
}
168+
// To locally check out the poms
169+
maven {
170+
val releasesRepoUrl = uri("$buildDir/repos/releases")
171+
val snapshotsRepoUrl = uri("$buildDir/repos/snapshots")
172+
name = "BuildDir"
173+
url = if (project.extra["isReleaseVersion"] as Boolean) releasesRepoUrl else snapshotsRepoUrl
174+
}
175+
maven {
176+
val releasesRepoUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
177+
val snapshotsRepoUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/")
178+
name = "SonatypeOSS"
179+
url = if (project.extra["isReleaseVersion"] as Boolean) releasesRepoUrl else snapshotsRepoUrl
180+
credentials {
181+
val ossrhUsername: String by project
182+
val ossrhPassword: String by project
183+
username = ossrhUsername
184+
password = ossrhPassword
183185
}
186+
}
184187
}
185188
}
186189
}
187190
}
191+
192+
signing {
193+
sign(publishing.publications["mavenJava"])
194+
}

0 commit comments

Comments
 (0)