diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index 1ac3cf09103..9c74e1a1ce4 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -84,7 +84,7 @@ pipeline { dir(getRepoName()) { if (githubscm.isBranchExist('origin',getPRBranch())) { githubscm.removeRemoteBranch('origin', getPRBranch()) - } + } githubscm.createBranch(getPRBranch()) } } @@ -103,7 +103,12 @@ pipeline { stage('Build & Test') { steps { script { - getMavenCommand().withProperty('maven.test.failure.ignore', true).skipTests(params.SKIP_TESTS).run('clean install') + getMavenCommand() + .withOptions(env.DROOLS_BUILD_MVN_OPTS ? [ env.DROOLS_BUILD_MVN_OPTS ] : []) + .withOptions(env.BUILD_MVN_OPTS_CURRENT ? [ env.BUILD_MVN_OPTS_CURRENT ] : []) + .withProperty('maven.test.failure.ignore', true) + .skipTests(params.SKIP_TESTS) + .run('clean install') } } post { @@ -261,6 +266,7 @@ MavenCommand getMavenCommand(String directory = '') { directory = directory ?: getRepoName() def mvnCmd = new MavenCommand(this, ['-fae', '-ntp']) .withSettingsXmlId(env.MAVEN_SETTINGS_CONFIG_FILE_ID) + .withOptions(env.BUILD_MVN_OPTS ? [ env.BUILD_MVN_OPTS ] : []) .inDirectory(directory) if (!isMainStream()) { // Workaround as enforcer rules may not be fixed on other streams mvnCmd.withProperty('enforcer.skip') @@ -279,7 +285,10 @@ void runMavenDeploy(boolean localDeployment = false) { mvnCmd.withDeployRepository(env.MAVEN_DEPLOY_REPOSITORY) } - mvnCmd.skipTests(true).run('clean deploy') + mvnCmd.skipTests(true) + .withOptions(env.DROOLS_BUILD_MVN_OPTS ? [ env.DROOLS_BUILD_MVN_OPTS ] : []) + .withOptions(env.BUILD_MVN_OPTS_CURRENT ? [ env.BUILD_MVN_OPTS_CURRENT ] : []) + .run('clean deploy') } void runMavenStage() { diff --git a/.ci/jenkins/Jenkinsfile.promote b/.ci/jenkins/Jenkinsfile.promote index 4e9db642c5c..137016d6356 100644 --- a/.ci/jenkins/Jenkinsfile.promote +++ b/.ci/jenkins/Jenkinsfile.promote @@ -75,7 +75,13 @@ pipeline { } steps { script { - getMavenCommand().inDirectory(getRepoName()).skipTests(true).withProperty('full').run('clean install') + getMavenCommand() + .withOptions(env.DROOLS_BUILD_MVN_OPTS ? [ env.DROOLS_BUILD_MVN_OPTS ] : []) + .withOptions(env.BUILD_MVN_OPTS_CURRENT ? [ env.BUILD_MVN_OPTS_CURRENT ] : []) + .inDirectory(getRepoName()) + .skipTests(true) + .withProperty('full') + .run('clean install') uploadFileMgmt(getRepoName()) } } @@ -195,6 +201,7 @@ void tagLatest() { MavenCommand getMavenCommand() { mvnCmd = new MavenCommand(this, ['-fae', '-ntp']) .withSettingsXmlId("${env.MAVEN_SETTINGS_CONFIG_FILE_ID}") + .withOptions(env.BUILD_MVN_OPTS ? [ env.BUILD_MVN_OPTS ] : []) if (env.MAVEN_DEPENDENCIES_REPOSITORY) { mvnCmd.withDependencyRepositoryInSettings('deps-repo', env.MAVEN_DEPENDENCIES_REPOSITORY) } diff --git a/.ci/jenkins/Jenkinsfile.quarkus-3.rewrite.pr b/.ci/jenkins/Jenkinsfile.quarkus-3.rewrite.pr index 32a52049344..4625604cb49 100644 --- a/.ci/jenkins/Jenkinsfile.quarkus-3.rewrite.pr +++ b/.ci/jenkins/Jenkinsfile.quarkus-3.rewrite.pr @@ -79,9 +79,3 @@ String getRepoName() { String getGitAuthorCredsId() { return env.AUTHOR_CREDS_ID } - -MavenCommand getMavenCommand() { - return new MavenCommand(this, ['-fae', '-ntp']) - .withSettingsXmlId(env.MAVEN_SETTINGS_CONFIG_FILE_ID) - .withProperty('full') -} diff --git a/.ci/jenkins/Jenkinsfile.quarkus-3.rewrite.standalone b/.ci/jenkins/Jenkinsfile.quarkus-3.rewrite.standalone index 8d2fa7ba6ed..f4b29582204 100644 --- a/.ci/jenkins/Jenkinsfile.quarkus-3.rewrite.standalone +++ b/.ci/jenkins/Jenkinsfile.quarkus-3.rewrite.standalone @@ -152,9 +152,3 @@ String getGitAuthorCredsId() { String getPRBranch() { return "${getBuildBranch()}-${env.PR_BRANCH_HASH}" } - -MavenCommand getMavenCommand() { - return new MavenCommand(this, ['-fae', '-ntp']) - .withSettingsXmlId(env.MAVEN_SETTINGS_CONFIG_FILE_ID) - .withProperty('full') -} diff --git a/.ci/jenkins/Jenkinsfile.setup-branch b/.ci/jenkins/Jenkinsfile.setup-branch index ebbc6cfb8cb..e481edfac66 100644 --- a/.ci/jenkins/Jenkinsfile.setup-branch +++ b/.ci/jenkins/Jenkinsfile.setup-branch @@ -82,7 +82,7 @@ pipeline { } steps { script { - build job: '../tools/kie-benchmarks-update-drools', parameters: [ string(name: 'NEW_VERSION', value: "${getDroolsVersion()}")] + build job: '../tools/kie-benchmarks-update-drools', parameters: [ string(name: 'NEW_VERSION', value: "${getDroolsVersion()}")] } } } @@ -137,6 +137,7 @@ String getGitAuthorCredsId() { MavenCommand getMavenCommand() { return new MavenCommand(this, ['-fae', '-ntp']) .withSettingsXmlId(env.MAVEN_SETTINGS_CONFIG_FILE_ID) + .withOptions(env.BUILD_MVN_OPTS ? [ env.BUILD_MVN_OPTS ] : []) .withProperty('full') }