From 40ff3424ca29c122186b0e1fbb997d3879c9f344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Thu, 4 Jun 2020 08:07:01 +0200 Subject: [PATCH] Enable automatic Maven Central sync when calling task bintrayPublish Copied from https://github.com/hibernate/hibernate-reactive/pull/246 Note you need to call the bintrayPublish task after calling bintrayUpload, otherwise it won't work. So you will need to use something like this: ./gradlew bintrayUpload bintrayPublish -P PERSONAL_BINTRAY_USER=... -P PERSONAL_BINTRAY_API_KEY=... -P SONATYPE_OSSRH_USER=... -P SONATYPE_OSSRH_PASSWORD=... --- gradle/publishing-repos.gradle | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gradle/publishing-repos.gradle b/gradle/publishing-repos.gradle index b3245a10d5..e78d632903 100644 --- a/gradle/publishing-repos.gradle +++ b/gradle/publishing-repos.gradle @@ -14,8 +14,10 @@ apply plugin: 'com.jfrog.bintray' ext { - bintrayUser = project.hasProperty( 'PERSONAL_BINTRAY_USER' ) ? project.property( 'PERSONAL_BINTRAY_USER' ) : null - bintrayKey = project.hasProperty( 'PERSONAL_BINTRAY_API_KEY' ) ? project.property( 'PERSONAL_BINTRAY_API_KEY' ) : null + bintrayUser = project.findProperty( 'PERSONAL_BINTRAY_USER' ) + bintrayKey = project.findProperty( 'PERSONAL_BINTRAY_API_KEY' ) + sonatypeOssrhUser = project.findProperty( 'SONATYPE_OSSRH_USER' ) + sonatypeOssrhPassword = project.findProperty( 'SONATYPE_OSSRH_PASSWORD' ) } @@ -58,6 +60,8 @@ bintray { ] mavenCentralSync { sync = true + user = project.sonatypeOssrhUser + password = project.sonatypeOssrhPassword } } }