From f3ec7eac118edc45c51ba12a52e5726c34e53795 Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Mon, 3 Aug 2026 11:30:08 +0100 Subject: [PATCH 1/3] Migrate from Commons Lang 2 to Commons Lang 3 --- pom.xml | 4 ++++ src/main/java/hudson/plugins/release/ReleaseWrapper.java | 2 +- src/main/java/hudson/plugins/release/ViewJobFilterUtils.java | 2 +- .../java/hudson/plugins/release/pipeline/ReleaseStep.java | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index b2fd599..afc8330 100644 --- a/pom.xml +++ b/pom.xml @@ -44,6 +44,10 @@ + + io.jenkins.plugins + commons-lang3-api + org.jenkins-ci.plugins script-security diff --git a/src/main/java/hudson/plugins/release/ReleaseWrapper.java b/src/main/java/hudson/plugins/release/ReleaseWrapper.java index fbd27ea..008f559 100644 --- a/src/main/java/hudson/plugins/release/ReleaseWrapper.java +++ b/src/main/java/hudson/plugins/release/ReleaseWrapper.java @@ -86,7 +86,7 @@ import net.sf.json.JSONArray; import net.sf.json.JSONObject; -import org.apache.commons.lang.ArrayUtils; +import org.apache.commons.lang3.ArrayUtils; import org.jenkinsci.plugins.jobgenerator.JobGenerator; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; diff --git a/src/main/java/hudson/plugins/release/ViewJobFilterUtils.java b/src/main/java/hudson/plugins/release/ViewJobFilterUtils.java index 4e9dc02..4517c16 100644 --- a/src/main/java/hudson/plugins/release/ViewJobFilterUtils.java +++ b/src/main/java/hudson/plugins/release/ViewJobFilterUtils.java @@ -26,7 +26,7 @@ import hudson.model.BuildableItemWithBuildWrappers; import hudson.model.TopLevelItem; -import org.apache.commons.lang.Validate; +import org.apache.commons.lang3.Validate; final class ViewJobFilterUtils { diff --git a/src/main/java/hudson/plugins/release/pipeline/ReleaseStep.java b/src/main/java/hudson/plugins/release/pipeline/ReleaseStep.java index 2e8c55c..f024870 100644 --- a/src/main/java/hudson/plugins/release/pipeline/ReleaseStep.java +++ b/src/main/java/hudson/plugins/release/pipeline/ReleaseStep.java @@ -38,7 +38,7 @@ import jenkins.model.ParameterizedJobMixIn; import net.sf.json.JSONArray; import net.sf.json.JSONObject; -import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang3.StringUtils; import org.kohsuke.accmod.restrictions.NoExternalUse; /** From e983f9001f6c5842cdfddba2481190a0120b1fea Mon Sep 17 00:00:00 2001 From: Tim Jacomb <21194782+timja@users.noreply.github.com> Date: Mon, 3 Aug 2026 13:23:47 +0100 Subject: [PATCH 2/3] Update Jenkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 42dfcbe..56a3cb4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,6 +5,6 @@ buildPlugin( useContainerAgent: true, // Set to `false` if you need to use Docker for containerized tests configurations: [ - [platform: 'linux', jdk: 17], - [platform: 'windows', jdk: 11], + [platform: 'linux', jdk: 25], + [platform: 'windows', jdk: 21], ]) From 1513496d61951cabb88f5d318c49bb08388c6786 Mon Sep 17 00:00:00 2001 From: Tim Jacomb Date: Mon, 3 Aug 2026 23:07:47 +0100 Subject: [PATCH 3/3] Modernise the baseline so the build works on current CI The old toolchain could not generate the @Extension index on Java 25, so no descriptors registered and six tests failed. This also fails on master. - parent 4.66 -> 6.2211.v27f680c93c53, Jenkins baseline 2.387.3 -> 2.479.3, BOM updated to match; enables the ban-commons-lang-2 enforcer rule - let the BOM manage maven-plugin, promoted-builds, config-file-provider and ant so the optional plugins stay mutually loadable - pin javax.annotation-api 1.3.2; maven-plugin pulls 1.2 and 1.3.2 down different paths, tripping RequireUpperBoundDeps - replace the removed @Bug test annotation with @Issue - ReleaseStepTest: wait for the downstream build before deleting it, which was a pre-existing race mvn clean verify passes on Java 21 and Java 25. --- pom.xml | 21 ++++++++++++------- .../release/TestReleasePluginMatrixJob.java | 4 ++-- .../release/pipeline/ReleaseStepTest.java | 3 +++ 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/pom.xml b/pom.xml index afc8330..7cf5b70 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.jenkins-ci.plugins plugin - 4.66 + 6.2211.v27f680c93c53 release hpi @@ -16,7 +16,9 @@ https://github.com/jenkinsci/release-plugin - 2.387.3 + 2.479 + ${jenkins.baseline}.3 + false @@ -30,11 +32,18 @@ io.jenkins.tools.bom - bom-2.387.x - 2133.v2e6c00fe4d61 + bom-${jenkins.baseline}.x + 5054.v620b_5d2b_d5e6 import pom + + + javax.annotation + javax.annotation-api + 1.3.2 + commons-net commons-net @@ -55,7 +64,6 @@ org.jenkins-ci.main maven-plugin - 3.15.1 org.apache.commons @@ -83,7 +91,6 @@ org.jenkins-ci.plugins promoted-builds - 3.10 true @@ -106,7 +113,6 @@ org.jenkins-ci.plugins config-file-provider - 3.8.1 true @@ -138,7 +144,6 @@ org.jenkins-ci.plugins ant - 1.12 test diff --git a/src/test/java/hudson/plugins/release/TestReleasePluginMatrixJob.java b/src/test/java/hudson/plugins/release/TestReleasePluginMatrixJob.java index 2579b00..88cdebe 100644 --- a/src/test/java/hudson/plugins/release/TestReleasePluginMatrixJob.java +++ b/src/test/java/hudson/plugins/release/TestReleasePluginMatrixJob.java @@ -9,7 +9,7 @@ import org.junit.Before; import org.junit.Rule; import org.junit.Test; -import org.jvnet.hudson.test.Bug; +import org.jvnet.hudson.test.Issue; import org.jvnet.hudson.test.JenkinsRule; /** @@ -37,7 +37,7 @@ public void deleteJob() throws Exception { * @throws Exception */ @Test - @Bug(31159) + @Issue("JENKINS-31159") public void testMatrixStepsSubmission() throws Exception { // prepare wrapper with some randomly chosen build steps final ReleaseWrapper originalWrapper = new ReleaseWrapper(); diff --git a/src/test/java/hudson/plugins/release/pipeline/ReleaseStepTest.java b/src/test/java/hudson/plugins/release/pipeline/ReleaseStepTest.java index 56c454a..91f55c2 100644 --- a/src/test/java/hudson/plugins/release/pipeline/ReleaseStepTest.java +++ b/src/test/java/hudson/plugins/release/pipeline/ReleaseStepTest.java @@ -36,6 +36,9 @@ public void releaseFreeStyleProject() throws Exception { WorkflowJob us = j.jenkins.createProject(WorkflowJob.class, "us"); us.setDefinition(new CpsFlowDefinition("release 'ds'\n echo \"release's done\"", true)); j.assertLogContains("release's done", j.buildAndAssertSuccess(us)); + // the upstream build returns as soon as the release step is done, so the downstream + // build can still be running here and would refuse to be deleted + j.waitUntilNoActivity(); ds.getBuildByNumber(1).delete(); }