diff --git a/java/build.gradle b/java/build.gradle index e76f39bed2..9e2d4af1a5 100644 --- a/java/build.gradle +++ b/java/build.gradle @@ -82,10 +82,11 @@ ext.setUpSigningKey = { signingExt -> } nexusPublishing { + useStaging = false repositories { gluonNexus { nexusUrl = uri(project.findProperty('sonatypeRepo') ?: "https://oss.sonatype.org/service/local/") - snapshotRepositoryUrl = uri(project.findProperty('sonatypeSnapshotRepo') ?: "https://oss.sonatype.org/content/repositories/snapshots/") + snapshotRepositoryUrl = uri(isReleaseBuild() ? (project.findProperty('sonatypeRepo') ?: "https://oss.sonatype.org/service/local/") : (project.findProperty('sonatypeSnapshotRepo') ?: "https://oss.sonatype.org/content/repositories/snapshots/")) username = project.findProperty('sonatypeUsername') ?: "" password = project.findProperty('sonatypePassword') ?: "" }