@@ -14,14 +14,15 @@ pipeline {
1414 GITLAB_URL = credentials(' gitlab_url' )
1515 MVN_REPO_LOGIN = credentials(' objectbox_internal_mvn_user' )
1616 MVN_REPO_URL = credentials(' objectbox_internal_mvn_repo_http' )
17- MVN_REPO_ARGS = " -PinternalObjectBoxRepo=$MVN_REPO_URL " +
18- " -PinternalObjectBoxRepoUser=$MVN_REPO_LOGIN_USR " +
19- " -PinternalObjectBoxRepoPassword=$MVN_REPO_LOGIN_PSW "
17+ // Warning: use single quotes to avoid Groovy String interpolation leaking secrets.
18+ MVN_REPO_ARGS = ' -PinternalObjectBoxRepo=$MVN_REPO_URL ' +
19+ ' -PinternalObjectBoxRepoUser=$MVN_REPO_LOGIN_USR ' +
20+ ' -PinternalObjectBoxRepoPassword=$MVN_REPO_LOGIN_PSW'
2021 MVN_REPO_UPLOAD_URL = credentials(' objectbox_internal_mvn_repo' )
21- MVN_REPO_UPLOAD_ARGS = " -PpreferredRepo=$MVN_REPO_UPLOAD_URL " +
22- " -PpreferredUsername=$MVN_REPO_LOGIN_USR " +
23- " -PpreferredPassword=$MVN_REPO_LOGIN_PSW " +
24- " -PversionPostFix=$versionPostfix "
22+ MVN_REPO_UPLOAD_ARGS = ' -PpreferredRepo=$MVN_REPO_UPLOAD_URL ' +
23+ ' -PpreferredUsername=$MVN_REPO_LOGIN_USR ' +
24+ ' -PpreferredPassword=$MVN_REPO_LOGIN_PSW ' +
25+ ' -PversionPostFix=$versionPostfix'
2526 // Note: for key use Jenkins secret file with PGP key as text in ASCII-armored format.
2627 ORG_GRADLE_PROJECT_signingKeyFile = credentials(' objectbox_signing_key' )
2728 ORG_GRADLE_PROJECT_signingKeyId = credentials(' objectbox_signing_key_id' )
@@ -81,9 +82,10 @@ pipeline {
8182
8283 // Note: supply internal Maven repo as tests use native dependencies (can't publish those without the Java libraries).
8384 // Note: add quotes around URL parameter to avoid line breaks due to semicolon in URL.
85+ // Warning: use single quotes to avoid Groovy String interpolation leaking secrets.
8486 sh " ./gradlew $gradleArgs $MVN_REPO_ARGS " +
85- " \" -PpreferredRepo=${ BINTRAY_URL} \" -PpreferredUsername=${ BINTRAY_LOGIN_USR} -PpreferredPassword=${ BINTRAY_LOGIN_PSW} " +
86- " uploadArchives"
87+ ' \" -PpreferredRepo=$BINTRAY_URL\" -PpreferredUsername=$BINTRAY_LOGIN_USR -PpreferredPassword=$BINTRAY_LOGIN_PSW ' +
88+ ' uploadArchives'
8789
8890 googlechatnotification url : ' id:gchat_java' ,
8991 message : " Published ${ currentBuild.fullDisplayName} successfully to Bintray - check https://bintray.com/objectbox/objectbox\n ${ env.BUILD_URL} "
0 commit comments