File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed
Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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
7885signing {
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
You can’t perform that action at this time.
0 commit comments