diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index 2a06609679a..a828be9b415 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -406,12 +406,16 @@ MavenCommand getOptaplannerQuickstartsMavenCommand() { * Builds the parent modules and the BOM so that project depending on these artifacts can resolve. */ void mavenCleanInstallOptaPlannerParents() { - configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) { - getOptaplannerMavenCommand() - .skipTests(true) - .withOptions(['-U', '-pl org.optaplanner:optaplanner-build-parent,org.optaplanner:optaplanner-bom', '-am']) - .withSettingsXmlFile(MAVEN_SETTINGS_FILE) - .run('clean install') + withCredentials([usernamePassword(credentialsId: env.MAVEN_REPO_CREDS_ID, usernameVariable: 'REPOSITORY_USER', passwordVariable: 'REPOSITORY_TOKEN')]) { + configFileProvider([configFile(fileId: env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) { + getOptaplannerMavenCommand() + .skipTests(true) + .withOptions(['-U', '-pl org.optaplanner:optaplanner-build-parent,org.optaplanner:optaplanner-bom', '-am']) + .withSettingsXmlFile(MAVEN_SETTINGS_FILE) + .withProperty('apache.repository.username', "${REPOSITORY_USER}") + .withProperty('apache.repository.password', "${REPOSITORY_TOKEN}") + .run('clean install') + } } }