Skip to content

Commit 8ac3911

Browse files
committed
Migrate from EE 8 to EE 9
1 parent 7531505 commit 8ac3911

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

pom.xml

+7-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<parent>
55
<groupId>org.jenkins-ci.plugins</groupId>
66
<artifactId>plugin</artifactId>
7-
<version>4.86</version>
7+
<version>5.7</version>
8+
<relativePath />
89
</parent>
910

1011
<artifactId>localization-zh-cn</artifactId>
@@ -14,15 +15,16 @@
1415
<url>https://github.com/jenkinsci/localization-zh-cn-plugin</url>
1516

1617
<scm>
17-
<connection>scm:git:ssh://github.com/jenkinsci/${project.artifactId}-plugin.git</connection>
18-
<developerConnection>scm:git:[email protected]:jenkinsci/${project.artifactId}-plugin.git</developerConnection>
19-
<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
18+
<connection>scm:git:https://github.com/${gitHubRepo}.git</connection>
19+
<developerConnection>scm:git:[email protected]:${gitHubRepo}.git</developerConnection>
20+
<url>https://github.com/${gitHubRepo}</url>
2021
<tag>${scmTag}</tag>
2122
</scm>
2223

2324
<properties>
24-
<jenkins.version>2.387.3</jenkins.version>
25+
<jenkins.version>2.479.1</jenkins.version>
2526
<changelist>999999-SNAPSHOT</changelist>
27+
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
2628
</properties>
2729

2830
<repositories>
@@ -181,10 +183,6 @@
181183
</build>
182184

183185
<dependencies>
184-
<dependency>
185-
<groupId>org.jenkins-ci</groupId>
186-
<artifactId>symbol-annotation</artifactId>
187-
</dependency>
188186
<dependency>
189187
<groupId>io.jenkins.plugins</groupId>
190188
<artifactId>localization-support</artifactId>

src/main/java/io/jenkins/plugins/localization_zh_cn/CommunityDecorator.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
import hudson.model.PageDecorator;
55
import hudson.model.User;
66
import org.kohsuke.stapler.Stapler;
7-
import org.kohsuke.stapler.StaplerRequest;
7+
import org.kohsuke.stapler.StaplerRequest2;
88

99
import java.util.Locale;
1010

1111
@Extension
1212
public class CommunityDecorator extends PageDecorator {
1313
public boolean isCurrentLanguage() {
14-
StaplerRequest req = Stapler.getCurrentRequest();
14+
StaplerRequest2 req = Stapler.getCurrentRequest2();
1515
if(req == null) {
1616
return false;
1717
}

src/main/java/io/jenkins/plugins/localization_zh_cn/UpdateCenterAction.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
import java.nio.charset.StandardCharsets;
77
import jenkins.model.Jenkins;
88
import org.apache.commons.io.IOUtils;
9-
import org.kohsuke.stapler.StaplerResponse;
9+
import org.kohsuke.stapler.StaplerResponse2;
1010
import org.kohsuke.stapler.interceptor.RequirePOST;
1111

1212
import edu.umd.cs.findbugs.annotations.CheckForNull;
13-
import javax.servlet.ServletContext;
14-
import javax.servlet.http.HttpServletResponse;
13+
import jakarta.servlet.ServletContext;
14+
import jakarta.servlet.http.HttpServletResponse;
1515
import java.io.*;
1616
import java.net.URL;
1717
import java.net.URLDecoder;
@@ -23,13 +23,13 @@ public class UpdateCenterAction implements RootAction {
2323

2424
@RequirePOST
2525
@SuppressFBWarnings(value = {"NP_LOAD_OF_KNOWN_NULL_VALUE", "RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"}, justification = "Spotbugs doesn't grok try-with-resources")
26-
public void doUse(StaplerResponse response) throws IOException {
26+
public void doUse(StaplerResponse2 response) throws IOException {
2727
if (!Jenkins.get().hasPermission(Jenkins.ADMINISTER)) {
2828
response.sendError(HttpServletResponse.SC_FORBIDDEN);
2929
return;
3030
}
3131

32-
ServletContext context = Jenkins.get().servletContext;
32+
ServletContext context = Jenkins.get().getServletContext();
3333
if (context == null) {
3434
LOGGER.warning("cannot get the servlet context when use the mirror certificate");
3535
return;
@@ -51,7 +51,7 @@ public void doUse(StaplerResponse response) throws IOException {
5151
}
5252

5353
@RequirePOST
54-
public void doRemove(StaplerResponse response) throws IOException {
54+
public void doRemove(StaplerResponse2 response) throws IOException {
5555
if (!Jenkins.get().hasPermission(Jenkins.ADMINISTER)) {
5656
response.sendError(HttpServletResponse.SC_FORBIDDEN);
5757
return;

0 commit comments

Comments
 (0)