Skip to content

Commit

Permalink
Merge pull request #318 from basil/jakarta
Browse files Browse the repository at this point in the history
Require Java 17 or newer; migrate to EE 9
  • Loading branch information
jglick authored Oct 10, 2024
2 parents d8886e0 + a2c173b commit 619cb15
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 16 deletions.
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.88</version>
<version>5.1</version>
<relativePath/>
</parent>

Expand All @@ -17,7 +17,7 @@
<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
<properties>
<changelist>999999-SNAPSHOT</changelist>
<jenkins.version>2.414.3</jenkins.version>
<jenkins.version>2.479</jenkins.version>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
</properties>
<licenses>
Expand Down Expand Up @@ -51,8 +51,8 @@
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.414.x</artifactId>
<version>2982.vdce2153031a_0</version>
<artifactId>bom-2.462.x</artifactId>
<version>3435.v238d66a_043fb_</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import org.kohsuke.stapler.AncestorInPath;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;

public class ZipFileBinding extends AbstractOnDiskBinding<FileCredentials> {

Expand Down Expand Up @@ -77,7 +77,7 @@ public String getDisplayName() {
}

// @RequirePOST
public FormValidation doCheckCredentialsId(StaplerRequest req, @AncestorInPath Item owner, @QueryParameter String value) {
public FormValidation doCheckCredentialsId(StaplerRequest2 req, @AncestorInPath Item owner, @QueryParameter String value) {
//TODO due to weird behavior in c:select, there are initial calls using GET
// so using this approach will prevent 405 errors
if (!req.getMethod().equals("POST")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.TestExtension;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;

import java.io.IOException;
import java.util.Collections;
Expand Down Expand Up @@ -114,7 +114,7 @@ public boolean isApplicable(AbstractProject<?, ?> item) {
}

@Override
public BuildWrapper newInstance(StaplerRequest req, @NonNull JSONObject formData) {
public BuildWrapper newInstance(StaplerRequest2 req, @NonNull JSONObject formData) {
return new BuildWrapperOrder();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.junit.runner.RunWith;
import org.jvnet.hudson.test.JenkinsRule;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
Expand Down Expand Up @@ -104,7 +103,7 @@ public static void assumeAsh() {
}

@Before
public void setUp() throws IOException {
public void setUp() throws Exception {
j.jenkins.getDescriptorByType(Shell.DescriptorImpl.class).setShell(Executables.getPathToExecutable("ash"));
project = j.createProject(WorkflowJob.class);
credentialsId = UUID.randomUUID().toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.junit.runner.RunWith;
import org.jvnet.hudson.test.JenkinsRule;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
Expand Down Expand Up @@ -91,7 +90,7 @@ public static void assumeBash() {
}

@Before
public void setUp() throws IOException {
public void setUp() throws Exception {
j.jenkins.getDescriptorByType(Shell.DescriptorImpl.class).setShell(Executables.getPathToExecutable("bash"));
project = j.createProject(WorkflowJob.class);
credentialsId = UUID.randomUUID().toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import org.junit.runner.RunWith;
import org.jvnet.hudson.test.JenkinsRule;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
Expand Down Expand Up @@ -86,7 +85,7 @@ public static void assumeBash() {
}

@Before
public void setUp() throws IOException {
public void setUp() throws Exception {
project = j.createProject(WorkflowJob.class);
credentialsId = UUID.randomUUID().toString();
project.setDefinition(new CpsFlowDefinition(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static void setStringCredentials(ModelObject context, String credentialsI
* Registers the given value as a {@link UsernamePasswordCredentials} into the default {@link CredentialsProvider}.
* Returns the generated credential id for the registered credentials.
*/
public static String registerUsernamePasswordCredentials(ModelObject context, String username, String password) throws IOException {
public static String registerUsernamePasswordCredentials(ModelObject context, String username, String password) throws Exception {
String credentialsId = UUID.randomUUID().toString();
setUsernamePasswordCredentials(context, credentialsId, username, password);
return credentialsId;
Expand All @@ -72,7 +72,7 @@ public static String registerUsernamePasswordCredentials(ModelObject context, St
* Registers the given value as a {@link UsernamePasswordCredentials} into the default {@link CredentialsProvider} using the
* specified credentials id.
*/
public static void setUsernamePasswordCredentials(ModelObject context, String credentialsId, String username, String password) throws IOException {
public static void setUsernamePasswordCredentials(ModelObject context, String credentialsId, String username, String password) throws Exception {
UsernamePasswordCredentials creds = new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, credentialsId, null, username, password);
CredentialsProvider.lookupStores(context).iterator().next().addCredentials(Domain.global(), creds);
}
Expand Down

0 comments on commit 619cb15

Please sign in to comment.