Skip to content

Commit

Permalink
Merge pull request #502 from basil/jakarta
Browse files Browse the repository at this point in the history
Migrate from EE 8 to EE 9
  • Loading branch information
jglick authored Jan 14, 2025
2 parents d9f3500 + 466a351 commit f528356
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 26 deletions.
9 changes: 5 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.88</version>
<version>5.3</version>
<relativePath/>
</parent>

Expand Down Expand Up @@ -69,8 +69,9 @@
<changelist>999999-SNAPSHOT</changelist>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
<jenkins.baseline>2.452</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.4</jenkins.version>
<jenkins.baseline>2.479</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.1</jenkins.version>

<hpi.compatibleSinceVersion>2.0.0</hpi.compatibleSinceVersion>
<no-test-jar>false</no-test-jar>
</properties>
Expand All @@ -80,7 +81,7 @@
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-${jenkins.baseline}.x</artifactId>
<version>3850.vb_c5319efa_e29</version>
<version>3893.v213a_42768d35</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/jenkins/branch/BaseEmptyView.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import javax.servlet.ServletException;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import jakarta.servlet.ServletException;
import org.kohsuke.stapler.StaplerRequest2;
import org.kohsuke.stapler.StaplerResponse2;

/**
* Holds the basic 'empty view' parent
Expand Down Expand Up @@ -100,14 +100,14 @@ public void onJobRenamed(Item item, String oldName, String newName) {
* {@inheritDoc}
*/
@Override
protected void submit(StaplerRequest req) throws IOException, ServletException, FormException {
protected void submit(StaplerRequest2 req) throws IOException, ServletException, FormException {
}

/**
* {@inheritDoc}
*/
@Override
public Item doCreateItem(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
public Item doCreateItem(StaplerRequest2 req, StaplerResponse2 rsp) throws IOException, ServletException {
throw new UnsupportedOperationException();
}
}
2 changes: 1 addition & 1 deletion src/main/java/jenkins/branch/MetadataActionFolderIcon.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public String getImageOf(String size) {
String image = iconClassNameImageOf(size);
return image != null
? image
: (Stapler.getCurrentRequest().getContextPath() + Hudson.RESOURCE_PATH
: (Stapler.getCurrentRequest2().getContextPath() + Hudson.RESOURCE_PATH

Check warning on line 130 in src/main/java/jenkins/branch/MetadataActionFolderIcon.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 130 is not covered by tests
+ "/plugin/cloudbees-folder/images/" + size + "/folder.png");
}

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/jenkins/branch/MultiBranchProject.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import jakarta.servlet.ServletException;
import jenkins.model.Jenkins;
import jenkins.model.ParameterizedJobMixIn;
import jenkins.model.TransientActionFactory;
Expand All @@ -112,8 +112,8 @@
import org.jenkins.ui.icon.IconSpec;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.StaplerRequest2;
import org.kohsuke.stapler.StaplerResponse2;
import org.kohsuke.stapler.export.Exported;
import org.springframework.security.core.Authentication;

Expand Down Expand Up @@ -912,7 +912,7 @@ public synchronized BranchIndexing<P, R> getIndexing() {
* {@inheritDoc}
*/
@Override
protected void submit(StaplerRequest req, StaplerResponse rsp)
protected void submit(StaplerRequest2 req, StaplerResponse2 rsp)
throws IOException, ServletException, Descriptor.FormException {
super.submit(req, rsp);
List<SCMSource> _sources = new ArrayList<>();
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/jenkins/branch/OrganizationFolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
import java.util.logging.Logger;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import javax.servlet.ServletException;
import jakarta.servlet.ServletException;
import jenkins.model.Jenkins;
import jenkins.model.TransientActionFactory;
import jenkins.scm.api.SCMEvent;
Expand All @@ -102,8 +102,8 @@
import org.jenkinsci.Symbol;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.StaplerRequest2;
import org.kohsuke.stapler.StaplerResponse2;
import org.springframework.security.core.Authentication;
import org.springframework.security.access.AccessDeniedException;

Expand Down Expand Up @@ -377,7 +377,7 @@ public DescribableList<BranchBuildStrategy, BranchBuildStrategyDescriptor> getBu
* {@inheritDoc}
*/
@Override
protected void submit(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, Descriptor.FormException {
protected void submit(StaplerRequest2 req, StaplerResponse2 rsp) throws IOException, ServletException, Descriptor.FormException {
super.submit(req, rsp);

JSONObject json = req.getSubmittedForm();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;

import java.util.List;

Expand Down Expand Up @@ -73,7 +73,7 @@ public boolean isOwnerMultibranch(Item item) {
}

@Override
public JobProperty<?> newInstance(StaplerRequest req, JSONObject formData) throws FormException {
public JobProperty<?> newInstance(StaplerRequest2 req, JSONObject formData) throws FormException {
return formData.optBoolean("specified") ? super.newInstance(req, formData) : null;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/jenkins/branch/ProjectNameProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import jenkins.scm.api.SCMNavigator;
import jenkins.scm.api.SCMSourceObserver;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;

/**
* Holds the unmangled project name provided to {@link SCMSourceObserver#observe(String)} and used to create a
Expand Down Expand Up @@ -62,7 +62,7 @@ public String getName() {
}

@Override
public AbstractFolderProperty<?> reconfigure(StaplerRequest req, JSONObject form) throws Descriptor.FormException {
public AbstractFolderProperty<?> reconfigure(StaplerRequest2 req, JSONObject form) throws Descriptor.FormException {
return this;
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/jenkins/branch/RateLimitBranchProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
import org.jvnet.localizer.ResourceBundleHolder;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;

/**
* A branch property that limits how often a specific branch can be built.
Expand Down Expand Up @@ -397,7 +397,7 @@ public long getMillisecondsBetweenBuilds() {
public static class DescriptorImpl extends JobPropertyDescriptor {

@Override
public JobProperty<?> newInstance(StaplerRequest req, JSONObject formData) throws FormException {
public JobProperty<?> newInstance(StaplerRequest2 req, JSONObject formData) throws FormException {
JobPropertyImpl prop = (JobPropertyImpl) super.newInstance(req, formData);
return prop.getThrottle() != null ? prop : null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import edu.umd.cs.findbugs.annotations.CheckForNull;
import jenkins.util.NonLocalizable;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;

public class MockHealthReportBuildStep extends hudson.tasks.Builder {

Expand All @@ -31,7 +31,7 @@ public static final class DescriptorImpl extends Descriptor<Builder> {
public DescriptorImpl() {
}

public Builder newInstance(StaplerRequest req, @NonNull JSONObject data) {
public Builder newInstance(StaplerRequest2 req, @NonNull JSONObject data) {
throw new UnsupportedOperationException();
}
}
Expand Down

0 comments on commit f528356

Please sign in to comment.