Skip to content

Commit 22a27b1

Browse files
committed
Fixed maven central publishing
1 parent 9f28820 commit 22a27b1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

buildSrc/src/main/groovy/base.maven-central-publishing.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ publishing {
22
repositories {
33
maven {
44
name = "central"
5-
if (project.maven_version.endsWith("SNAPSHOT")) {
6-
url = "https://central.sonatype.com/repository/maven-snapshots"
7-
} else {
5+
if (!project.maven_version.endsWith("SNAPSHOT")) {
86
url = "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2"
7+
} else {
8+
url = "https://central.sonatype.com/repository/maven-snapshots"
99
}
1010

1111
credentials(PasswordCredentials)
@@ -17,7 +17,7 @@ publishing {
1717
}
1818

1919
tasks.withType(PublishToMavenRepository).configureEach {
20-
if (it.name.endsWith("ToCentralRepository")) {
20+
if (it.name.endsWith("ToCentralRepository") && !project.maven_version.endsWith("SNAPSHOT")) {
2121
def centralUsername = providers.gradleProperty("centralUsername")
2222
def centralPassword = providers.gradleProperty("centralPassword")
2323
def mavenGroup = it.publication.groupId

0 commit comments

Comments
 (0)