From ae954355232d76e8f01a91422d9b7554233a055e Mon Sep 17 00:00:00 2001 From: Benoit GUERIN Date: Wed, 27 Mar 2024 22:57:50 +0100 Subject: [PATCH] chore: switch to 2.440 baseline --- .../pipeline/maven/WithMavenStepExecution2.java | 15 ++++++++++----- .../pipeline/maven/WithMavenStepOnMasterTest.java | 3 ++- .../test_maven_projects/maven_hpi_project/pom.xml | 4 ++-- pom.xml | 6 +++--- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/pipeline-maven/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution2.java b/pipeline-maven/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution2.java index 9cb2230c..0bc9e2fe 100644 --- a/pipeline-maven/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution2.java +++ b/pipeline-maven/src/main/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepExecution2.java @@ -433,18 +433,23 @@ private void setupMaven(@NonNull Collection credentials) throws IOE } envOverride.put("MAVEN_CONFIG", mavenConfig.toString()); + console.trace("[withMaven] MAVEN_CONFIG: " + mavenConfig.toString()); // // MAVEN_OPTS + String mavenOpts = env.get(MAVEN_OPTS); if (StringUtils.isNotEmpty(step.getMavenOpts())) { - String mavenOpts = envOverride.expand(env.expand(step.getMavenOpts())); + String mavenOptsStep = envOverride.expand(env.expand(step.getMavenOpts())); - String mavenOpsOriginal = env.get(MAVEN_OPTS); - if (mavenOpsOriginal != null) { - mavenOpts = mavenOpts + " " + mavenOpsOriginal; + if (mavenOpts != null) { + mavenOpts = mavenOptsStep + " " + mavenOpts; + } else { + mavenOpts = mavenOptsStep; } - envOverride.put(MAVEN_OPTS, mavenOpts.replaceAll("[\t\r\n]+", " ")); + mavenOpts = mavenOpts.replaceAll("[\t\r\n]+", " "); + envOverride.put(MAVEN_OPTS, mavenOpts); } + console.trace("[withMaven] MAVEN_OPTS: " + mavenOpts); LOGGER.log(Level.FINE, "Using temp dir: {0}", tempBinDir.getRemote()); diff --git a/pipeline-maven/src/test/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepOnMasterTest.java b/pipeline-maven/src/test/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepOnMasterTest.java index db042bce..edf6def4 100644 --- a/pipeline-maven/src/test/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepOnMasterTest.java +++ b/pipeline-maven/src/test/java/org/jenkinsci/plugins/pipeline/maven/WithMavenStepOnMasterTest.java @@ -594,7 +594,8 @@ public void maven_build_maven_hpi_project_on_master_succeeds() throws Exception // @formatter:off String pipelineScript = "node() {\n" + " git($/" + gitRepoRule.toString() + "/$)\n" + - " withMaven(traceability: true) {\n" + + " m2repo = \"${pwd tmp: true}/m2repo\"\n" + + " withMaven(traceability: true, mavenLocalRepo: $m2repo) {\n" + " if (isUnix()) {\n" + " sh 'mvn -P!might-produce-incrementals package'\n" + " } else {\n" + diff --git a/pipeline-maven/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_hpi_project/pom.xml b/pipeline-maven/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_hpi_project/pom.xml index e341ca21..7b816d6d 100644 --- a/pipeline-maven/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_hpi_project/pom.xml +++ b/pipeline-maven/src/test/resources/org/jenkinsci/plugins/pipeline/maven/test/test_maven_projects/maven_hpi_project/pom.xml @@ -3,7 +3,7 @@ org.jenkins-ci.plugins plugin - 4.74 + 5.3 @@ -13,7 +13,7 @@ hpi - 2.387.3 + 2.486 diff --git a/pom.xml b/pom.xml index 7376dca2..dd1859db 100644 --- a/pom.xml +++ b/pom.xml @@ -100,8 +100,8 @@ 8.4.0-31.va_b_5ce7933762 42.7.2-40.v76d376d65c77 4.53 - 3208.vb_21177d4b_cd9 - 2.426.3 + 3258.vcdcf15936a_fd + 2.440.3 5.11.3 3.5.0 0.3.5 @@ -120,7 +120,7 @@ io.jenkins.tools.bom - bom-2.426.x + bom-2.440.x ${jenkins-tools-bom.version} pom import