From 71a75f0aaac1551c49cac2d266b5a92ee10c2a64 Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Thu, 10 Oct 2024 21:46:57 -0600 Subject: [PATCH] Require Jenkins 2.479.1 or newer Compile with Java 17 and Jakarta EE 9 --- pom.xml | 7 ++++--- .../nodelabelparameter/LabelParameterDefinition.java | 6 +++--- .../nodelabelparameter/NodeParameterDefinition.java | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 1f123e0..b2e3656 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin - 4.88 + 5.3 @@ -51,8 +51,9 @@ -SNAPSHOT jenkinsci/${project.artifactId}-plugin - 2.452 - ${jenkins.baseline}.4 + + 2.479 + ${jenkins.baseline}.1 UTF-8 1.13.1 Max diff --git a/src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/LabelParameterDefinition.java b/src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/LabelParameterDefinition.java index c44b75f..d9eab64 100644 --- a/src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/LabelParameterDefinition.java +++ b/src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/LabelParameterDefinition.java @@ -12,11 +12,11 @@ import hudson.model.SimpleParameterDefinition; import hudson.model.labels.LabelExpression; import hudson.util.FormValidation; +import jakarta.servlet.ServletException; import java.util.List; import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; -import javax.servlet.ServletException; import jenkins.model.Jenkins; import net.sf.json.JSONObject; import org.apache.commons.lang.StringUtils; @@ -26,7 +26,7 @@ import org.jvnet.jenkins.plugins.nodelabelparameter.wrapper.TriggerNextBuildWrapper; import org.kohsuke.stapler.DataBoundConstructor; import org.kohsuke.stapler.QueryParameter; -import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.StaplerRequest2; /** * Defines a build parameter used to restrict the node a job will be executed on. Such a label works @@ -220,7 +220,7 @@ public String apply(Node n) { } @Override - public ParameterValue createValue(StaplerRequest req, JSONObject jo) { + public ParameterValue createValue(StaplerRequest2 req, JSONObject jo) { LabelParameterValue value = req.bindJSON(LabelParameterValue.class, jo); value.setDescription(getDescription()); diff --git a/src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/NodeParameterDefinition.java b/src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/NodeParameterDefinition.java index ee4d9ba..f2b519d 100644 --- a/src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/NodeParameterDefinition.java +++ b/src/main/java/org/jvnet/jenkins/plugins/nodelabelparameter/NodeParameterDefinition.java @@ -20,7 +20,7 @@ import org.jvnet.jenkins.plugins.nodelabelparameter.node.NodeEligibility; import org.jvnet.jenkins.plugins.nodelabelparameter.wrapper.TriggerNextBuildWrapper; import org.kohsuke.stapler.DataBoundConstructor; -import org.kohsuke.stapler.StaplerRequest; +import org.kohsuke.stapler.StaplerRequest2; /** * Defines a build parameter used to select the node where a job should be executed. Although it is @@ -250,7 +250,7 @@ public NodeEligibility getDefaultNodeEligibility() { } @Override - public ParameterValue createValue(StaplerRequest req, JSONObject jo) { + public ParameterValue createValue(StaplerRequest2 req, JSONObject jo) { // as String from UI: {"labels":"built-in","name":"HOSTN"} // as JSONArray: {"name":"HOSTN","value":["built-in","host2"]} // as String from script: {"name":"HOSTN","value":"built-in"}