Skip to content

Commit ca1ae5e

Browse files
committed
new publishing uris
1 parent 95423ef commit ca1ae5e

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ nexusPublishing {
2727
sonatype {
2828
username.set(publishUser)
2929
password.set(publishKey)
30+
31+
nexusUrl = uri("https://ossrh-staging-api.central.sonatype.com/service/local/")
32+
snapshotRepositoryUrl = uri("https://central.sonatype.com/repository/maven-snapshots/")
3033
}
3134
}
3235
}

buildSrc/src/main/kotlin/openapi-parser.publish-conventions.gradle.kts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,22 @@ publishing {
4747

4848
repositories {
4949
maven {
50-
val releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
51-
val snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
52-
url = uri(if (isReleaseVersion()) releasesRepoUrl else snapshotsRepoUrl)
50+
val releaseRepository = uri("https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2")
51+
val snapshotRepository = uri("https://central.sonatype.com/repository/maven-snapshots")
52+
url = uri(if (isReleaseVersion()) releaseRepository else snapshotRepository)
5353

5454
credentials {
5555
username = buildProperty("PUBLISH_USER")
5656
password = buildProperty("PUBLISH_KEY")
5757
}
5858
}
59+
60+
repositories {
61+
maven {
62+
name = "central"
63+
url = uri(rootProject.layout.buildDirectory.dir("central"))
64+
}
65+
}
5966
}
6067
}
6168

@@ -76,7 +83,11 @@ tasks.withType<GenerateModuleMetadata>().configureEach {
7683
// ORG_GRADLE_PROJECT_signPwd=...
7784

7885
signing {
79-
setRequired({ gradle.taskGraph.hasTask("${project.path}:publishToSonatype") })
86+
setRequired({
87+
gradle.taskGraph.allTasks.any {
88+
it.name.contains("ToSonatype") || it.name.contains("ToCentral")
89+
}
90+
})
8091

8192
val signKey: String? by project
8293
val signPwd: String? by project

0 commit comments

Comments
 (0)