Skip to content

Commit a4848ab

Browse files
authored
Merge pull request #94 from strangelookingnerd/mirgate
Require Jenkins 2.479.1 or newer and Jakarta EE 9
2 parents ae39d11 + 29186d8 commit a4848ab

19 files changed

+112
-61
lines changed

.mvn/wrapper/maven-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
18-
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
18+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar

debug.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
22
mvn versions:update-properties
3-
mvnDebug hpi:run -Djava.util.logging.config.file=logging.properties -Djenkins.version=2.462.1 -Denforcer.skip=true
3+
mvnDebug hpi:run -Djava.util.logging.config.file=logging.properties -Djenkins.version=2.479.3 -Denforcer.skip=true

pom.xml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
<parent>
66
<groupId>org.jenkins-ci.plugins</groupId>
77
<artifactId>plugin</artifactId>
8-
<version>4.87</version>
8+
<version>5.9</version>
99
<relativePath />
1010
</parent>
1111

1212
<properties>
1313
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
14-
<jenkins.baseline>2.462</jenkins.baseline>
15-
<jenkins.version>${jenkins.baseline}.1</jenkins.version>
16-
<maven.compiler.release>17</maven.compiler.release>
14+
<jenkins.baseline>2.479</jenkins.baseline>
15+
<jenkins.version>${jenkins.baseline}.3</jenkins.version>
1716
<maven.javadoc.skip>true</maven.javadoc.skip>
1817
<violations.version>2.2.0</violations.version>
1918
<changelog-lib>2.6.0</changelog-lib>
@@ -110,7 +109,7 @@
110109
<licenses>
111110
<license>
112111
<name>MIT License</name>
113-
<url>http://opensource.org/licenses/MIT</url>
112+
<url>https://opensource.org/licenses/MIT</url>
114113
</license>
115114
</licenses>
116115

@@ -200,6 +199,18 @@
200199
<groupId>commons-io</groupId>
201200
<artifactId>commons-io</artifactId>
202201
</exclusion>
202+
<exclusion>
203+
<groupId>org.ow2.asm</groupId>
204+
<artifactId>asm-tree</artifactId>
205+
</exclusion>
206+
<exclusion>
207+
<groupId>org.ow2.asm</groupId>
208+
<artifactId>asm-util</artifactId>
209+
</exclusion>
210+
<exclusion>
211+
<groupId>org.ow2.asm</groupId>
212+
<artifactId>asm-commons</artifactId>
213+
</exclusion>
203214
</exclusions>
204215
</dependency>
205216
<dependency>
@@ -273,7 +284,7 @@
273284
<dependency>
274285
<groupId>io.jenkins.tools.bom</groupId>
275286
<artifactId>bom-${jenkins.baseline}.x</artifactId>
276-
<version>3358.vea_fa_1f41504d</version>
287+
<version>4440.v39a_9eb_b_c6b_4d</version>
277288
<scope>import</scope>
278289
<type>pom</type>
279290
</dependency>

run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/sh
22
./mvnw versions:update-properties
3-
./mvnw hpi:run -Djava.util.logging.config.file=logging.properties -Djenkins.version=2.462.1 -Denforcer.skip=true
3+
./mvnw hpi:run -Djava.util.logging.config.file=logging.properties -Djenkins.version=2.479.3 -Denforcer.skip=true

src/main/java/org/jenkinsci/plugins/gitchangelog/GitChangelogDescriptor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import org.jenkinsci.plugins.gitchangelog.config.CredentialsHelper;
1313
import org.jenkinsci.plugins.gitchangelog.config.CustomIssue;
1414
import org.jenkinsci.plugins.gitchangelog.config.GitChangelogConfig;
15-
import org.kohsuke.stapler.StaplerRequest;
15+
import org.kohsuke.stapler.StaplerRequest2;
1616

1717
public final class GitChangelogDescriptor extends BuildStepDescriptor<Publisher> {
1818
private GitChangelogConfig config;
@@ -75,7 +75,7 @@ public boolean isApplicable(
7575
}
7676

7777
@Override
78-
public Publisher newInstance(final StaplerRequest req, final JSONObject formData)
78+
public Publisher newInstance(final StaplerRequest2 req, final JSONObject formData)
7979
throws hudson.model.Descriptor.FormException {
8080
final GitChangelogConfig c = new GitChangelogConfig();
8181
c.setUseConfigFile(formData.getBoolean("useConfigFile"));

src/main/java/org/jenkinsci/plugins/gitchangelog/config/CustomIssue.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package org.jenkinsci.plugins.gitchangelog.config;
22

3+
import java.io.Serial;
34
import java.io.Serializable;
45
import org.kohsuke.stapler.DataBoundConstructor;
56

67
public class CustomIssue implements Serializable {
8+
@Serial
79
private static final long serialVersionUID = -6202256680695752956L;
810
private String link;
911
private String name;

src/main/java/org/jenkinsci/plugins/gitchangelog/config/GitChangelogConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.jenkinsci.plugins.gitchangelog.config;
22

3+
import java.io.Serial;
34
import java.io.Serializable;
45
import java.util.ArrayList;
56
import java.util.List;
@@ -8,6 +9,7 @@
89

910
public class GitChangelogConfig implements Serializable {
1011

12+
@Serial
1113
private static final long serialVersionUID = -6715117454282183133L;
1214
private String configFile;
1315
private String createFileTemplateContent;

src/main/java/org/jenkinsci/plugins/gitchangelog/perform/RemoteCallable.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111
import static org.jenkinsci.plugins.gitchangelog.config.GitChangelogConfigHelper.FROMTYPE.ref;
1212
import static se.bjurr.gitchangelog.api.GitChangelogApi.gitChangelogApiBuilder;
1313

14-
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
1514
import java.io.File;
1615
import java.io.IOException;
1716
import java.io.PrintWriter;
17+
import java.io.Serial;
1818
import java.io.Serializable;
1919
import java.io.StringWriter;
2020
import java.net.URISyntaxException;
2121
import jenkins.security.MasterToSlaveCallable;
22+
import org.apache.commons.io.FileUtils;
2223
import org.jenkinsci.plugins.gitchangelog.config.CustomIssue;
2324
import org.jenkinsci.plugins.gitchangelog.config.GitChangelogConfig;
2425
import org.jenkinsci.plugins.gitchangelog.config.GitChangelogConfigHelper.FROMTYPE;
@@ -28,6 +29,7 @@
2829
public class RemoteCallable extends MasterToSlaveCallable<RemoteResult, IOException>
2930
implements Serializable {
3031

32+
@Serial
3133
private static final long serialVersionUID = -2489061314794088231L;
3234
private final GitChangelogConfig config;
3335
private String path = "";
@@ -41,7 +43,6 @@ public RemoteCallable(final String workspacePath, final GitChangelogConfig confi
4143
}
4244

4345
@Override
44-
@SuppressFBWarnings("RV_RETURN_VALUE_IGNORED_BAD_PRACTICE")
4546
public RemoteResult call() throws IOException {
4647
final RemoteResult remoteResult = new RemoteResult();
4748
final StringBuilder logString = new StringBuilder();
@@ -179,14 +180,14 @@ public RemoteResult call() throws IOException {
179180
logString.append("Creating changelog ").append(this.config.toFile());
180181

181182
final File toFile = new File(this.workspacePath + "/" + this.config.toFile());
182-
new File(toFile.getParent()).mkdirs();
183+
FileUtils.forceMkdir(new File(toFile.getParent()));
183184
write(gitChangelogApiBuilder.render(), toFile, UTF_8);
184185
}
185186
} catch (final Throwable e) {
186187
StringWriter sw = new StringWriter();
187188
PrintWriter pw = new PrintWriter(sw);
188189
e.printStackTrace(pw);
189-
logString.append(sw.toString());
190+
logString.append(sw);
190191
}
191192
remoteResult.setLog(logString.toString());
192193
return remoteResult;

src/main/java/org/jenkinsci/plugins/gitchangelog/perform/RemoteResult.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package org.jenkinsci.plugins.gitchangelog.perform;
22

3+
import java.io.Serial;
34
import java.io.Serializable;
45

56
public class RemoteResult implements Serializable {
67

8+
@Serial
79
private static final long serialVersionUID = 8363216067945804103L;
810
private String leftSideTitle;
911
private String leftSideUrl;

src/main/java/org/jenkinsci/plugins/gitchangelog/steps/GetHighestSemanticVersionStep.java

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import hudson.Extension;
1111
import hudson.FilePath;
1212
import java.io.IOException;
13+
import java.io.Serial;
1314
import java.io.Serializable;
1415
import java.text.ParseException;
1516
import jenkins.security.MasterToSlaveCallable;
@@ -25,6 +26,7 @@
2526

2627
public class GetHighestSemanticVersionStep extends Step implements Serializable {
2728

29+
@Serial
2830
private static final long serialVersionUID = 795555442767777209L;
2931
private String repo;
3032

@@ -81,26 +83,28 @@ public DescriptorImpl() {
8183

8284
@Override
8385
public StepExecution start(final StepContext context) {
84-
return new SynchronousNonBlockingStepExecution<Object>(context) {
86+
return new SynchronousNonBlockingStepExecution<>(context) {
8587

86-
private static final long serialVersionUID = 1L;
88+
@Serial
89+
private static final long serialVersionUID = 1L;
8790

88-
@Override
89-
protected Object run() throws Exception {
90-
final FilePath workspace = context.get(FilePath.class);
91+
@Override
92+
protected Object run() throws Exception {
93+
final FilePath workspace = context.get(FilePath.class);
9194

92-
final MasterToSlaveCallable<Object, Exception> callable =
93-
new MasterToSlaveCallable<Object, Exception>() {
94-
private static final long serialVersionUID = 1L;
95+
final MasterToSlaveCallable<Object, Exception> callable =
96+
new MasterToSlaveCallable<>() {
97+
@Serial
98+
private static final long serialVersionUID = 1L;
9599

96-
@Override
97-
public Object call() throws Exception {
98-
return GetHighestSemanticVersionStep.this.perform(workspace);
99-
}
100-
};
100+
@Override
101+
public Object call() throws Exception {
102+
return GetHighestSemanticVersionStep.this.perform(workspace);
103+
}
104+
};
101105

102-
return workspace.act(callable);
103-
}
106+
return workspace.act(callable);
107+
}
104108
};
105109
}
106110

0 commit comments

Comments
 (0)