Skip to content

Commit b1482bd

Browse files
VlatombeaHenryJard
andauthored
Apply routine updates to fix PCT with more recent Jenkins versions and JDK11 (jenkinsci#262)
* Apply routine updates to fix PCT with more recent Jenkins versions * Update jenkins.version to 2.277.1 * Update matching bom * Update maven wrapper to a current version * Remove usage of javax.annotation * Fix the test for incoming LTS 2.332 * Revert "Fix the test for incoming LTS 2.332" This reverts commit d36d9a3. * Upgrade wiremock * Avoid relying on jetty internal classes. Rely on the constant from java.net.HttpURLConnection instead. Co-authored-by: aHenryJard <ajard@cloudbees.com>
1 parent 4c21b36 commit b1482bd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+131
-175
lines changed

.mvn/wrapper/maven-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip
1+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip

pom.xml

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

@@ -50,7 +50,7 @@
5050
<revision>1.34.3</revision>
5151
<changelist>-SNAPSHOT</changelist>
5252
<gitHubRepo>jenkinsci/github-plugin</gitHubRepo>
53-
<jenkins.version>2.222.4</jenkins.version>
53+
<jenkins.version>2.277.1</jenkins.version>
5454
<release.skipTests>false</release.skipTests>
5555
<maven.javadoc.skip>true</maven.javadoc.skip>
5656
<findbugs-maven-plugin.version>3.0.4</findbugs-maven-plugin.version>
@@ -234,48 +234,9 @@
234234
<!--to mock github-->
235235
<dependency>
236236
<groupId>com.github.tomakehurst</groupId>
237-
<artifactId>wiremock</artifactId>
238-
<version>1.57</version>
237+
<artifactId>wiremock-jre8-standalone</artifactId>
238+
<version>2.32.0</version>
239239
<scope>test</scope>
240-
<classifier>standalone</classifier>
241-
<exclusions>
242-
<exclusion>
243-
<groupId>org.eclipse.jetty</groupId>
244-
<artifactId>jetty</artifactId>
245-
</exclusion>
246-
<exclusion>
247-
<groupId>com.google.guava</groupId>
248-
<artifactId>guava</artifactId>
249-
</exclusion>
250-
<exclusion>
251-
<groupId>org.apache.httpcomponents</groupId>
252-
<artifactId>httpclient</artifactId>
253-
</exclusion>
254-
<exclusion>
255-
<groupId>xmlunit</groupId>
256-
<artifactId>xmlunit</artifactId>
257-
</exclusion>
258-
<exclusion>
259-
<groupId>com.jayway.jsonpath</groupId>
260-
<artifactId>json-path</artifactId>
261-
</exclusion>
262-
<exclusion>
263-
<groupId>net.sf.jopt-simple</groupId>
264-
<artifactId>jopt-simple</artifactId>
265-
</exclusion>
266-
<exclusion>
267-
<groupId>com.fasterxml.jackson.core</groupId>
268-
<artifactId>jackson-annotations</artifactId>
269-
</exclusion>
270-
<exclusion>
271-
<groupId>com.fasterxml.jackson.core</groupId>
272-
<artifactId>jackson-core</artifactId>
273-
</exclusion>
274-
<exclusion>
275-
<groupId>com.fasterxml.jackson.core</groupId>
276-
<artifactId>jackson-databind</artifactId>
277-
</exclusion>
278-
</exclusions>
279240
</dependency>
280241

281242
<dependency>
@@ -291,16 +252,11 @@
291252
<dependencies>
292253
<dependency>
293254
<groupId>io.jenkins.tools.bom</groupId>
294-
<artifactId>bom-2.222.x</artifactId>
295-
<version>20</version>
255+
<artifactId>bom-2.277.x</artifactId>
256+
<version>984.vb5eaac999a7e</version>
296257
<scope>import</scope>
297258
<type>pom</type>
298259
</dependency>
299-
<dependency>
300-
<groupId>org.jenkins-ci</groupId>
301-
<artifactId>annotation-indexer</artifactId>
302-
<version>1.12</version>
303-
</dependency>
304260
</dependencies>
305261
</dependencyManagement>
306262

src/main/java/com/cloudbees/jenkins/Credential.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import org.kohsuke.github.GitHub;
88
import org.kohsuke.stapler.DataBoundConstructor;
99

10-
import javax.annotation.CheckForNull;
10+
import edu.umd.cs.findbugs.annotations.CheckForNull;
1111
import java.io.IOException;
1212

1313
import static org.jenkinsci.plugins.github.util.FluentIterableWrapper.from;

src/main/java/com/cloudbees/jenkins/GitHubCommitNotifier.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import org.slf4j.Logger;
3333
import org.slf4j.LoggerFactory;
3434

35-
import javax.annotation.Nonnull;
3635
import java.io.IOException;
3736
import java.util.Collections;
3837

@@ -92,17 +91,17 @@ public void setStatusMessage(ExpandableMessage statusMessage) {
9291
/**
9392
* @since 1.10
9493
*/
95-
@Nonnull
94+
@NonNull
9695
public String getResultOnFailure() {
9796
return resultOnFailure != null ? resultOnFailure : getDefaultResultOnFailure().toString();
9897
}
9998

100-
@Nonnull
99+
@NonNull
101100
public static Result getDefaultResultOnFailure() {
102101
return FAILURE;
103102
}
104103

105-
@Nonnull
104+
@NonNull
106105
/*package*/ Result getEffectiveResultOnFailure() {
107106
return Result.fromString(trimToEmpty(resultOnFailure));
108107
}

src/main/java/com/cloudbees/jenkins/GitHubPushTrigger.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
import org.slf4j.Logger;
3939
import org.slf4j.LoggerFactory;
4040

41-
import javax.annotation.Nonnull;
41+
import edu.umd.cs.findbugs.annotations.NonNull;
4242
import javax.inject.Inject;
4343
import java.io.File;
4444
import java.io.IOException;
@@ -182,7 +182,7 @@ public File getLogFile() {
182182
/**
183183
* Returns the file that records the last/current polling activity.
184184
*/
185-
private File getLogFileForJob(@Nonnull Job job) throws IOException {
185+
private File getLogFileForJob(@NonNull Job job) throws IOException {
186186
return new File(job.getRootDir(), "github-polling.log");
187187
}
188188

src/main/java/com/cloudbees/jenkins/GitHubRepositoryName.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
import org.slf4j.Logger;
1818
import org.slf4j.LoggerFactory;
1919

20-
import javax.annotation.CheckForNull;
21-
import javax.annotation.Nonnull;
20+
import edu.umd.cs.findbugs.annotations.CheckForNull;
21+
import edu.umd.cs.findbugs.annotations.NonNull;
2222
import java.io.IOException;
2323
import java.util.regex.Matcher;
2424
import java.util.regex.Pattern;
@@ -222,7 +222,7 @@ public String toString() {
222222
private static Function<GitHub, GHRepository> toGHRepository(final GitHubRepositoryName repoName) {
223223
return new NullSafeFunction<GitHub, GHRepository>() {
224224
@Override
225-
protected GHRepository applyNullSafe(@Nonnull GitHub gitHub) {
225+
protected GHRepository applyNullSafe(@NonNull GitHub gitHub) {
226226
try {
227227
return gitHub.getRepository(format("%s/%s", repoName.getUserName(), repoName.getRepositoryName()));
228228
} catch (IOException e) {

src/main/java/com/cloudbees/jenkins/GitHubWebHook.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.slf4j.Logger;
2626
import org.slf4j.LoggerFactory;
2727

28-
import javax.annotation.Nonnull;
28+
import edu.umd.cs.findbugs.annotations.NonNull;
2929
import java.net.URL;
3030
import java.util.List;
3131

@@ -116,7 +116,7 @@ public List<Item> reRegisterAllHooks() {
116116
*/
117117
@SuppressWarnings("unused")
118118
@RequirePostWithGHHookPayload
119-
public void doIndex(@Nonnull @GHEventHeader GHEvent event, @Nonnull @GHEventPayload String payload) {
119+
public void doIndex(@NonNull @GHEventHeader GHEvent event, @NonNull @GHEventPayload String payload) {
120120
GHSubscriberEvent subscriberEvent =
121121
new GHSubscriberEvent(SCMEvent.originOf(Stapler.getCurrentRequest()), event, payload);
122122
from(GHEventsSubscriber.all())
@@ -149,7 +149,7 @@ public static GitHubWebHook get() {
149149
return Jenkins.getInstance().getExtensionList(RootAction.class).get(GitHubWebHook.class);
150150
}
151151

152-
@Nonnull
152+
@NonNull
153153
public static Jenkins getJenkinsInstance() throws IllegalStateException {
154154
Jenkins instance = Jenkins.getInstance();
155155
Validate.validState(instance != null, "Jenkins has not been started, or was already shut down");

src/main/java/com/coravy/hudson/plugins/github/GithubProjectProperty.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import org.kohsuke.stapler.DataBoundSetter;
1212
import org.kohsuke.stapler.StaplerRequest;
1313

14-
import javax.annotation.CheckForNull;
15-
import javax.annotation.Nonnull;
14+
import edu.umd.cs.findbugs.annotations.CheckForNull;
15+
import edu.umd.cs.findbugs.annotations.NonNull;
1616
import org.jenkinsci.Symbol;
1717
import java.util.logging.Logger;
1818

@@ -89,7 +89,7 @@ public void setDisplayName(String displayName) {
8989
* @return display name or full job name if field is not defined
9090
* @since 1.14.1
9191
*/
92-
public static String displayNameFor(@Nonnull Job<?, ?> job) {
92+
public static String displayNameFor(@NonNull Job<?, ?> job) {
9393
GithubProjectProperty ghProp = job.getProperty(GithubProjectProperty.class);
9494
if (ghProp != null && isNotBlank(ghProp.getDisplayName())) {
9595
return ghProp.getDisplayName();
@@ -116,7 +116,7 @@ public String getDisplayName() {
116116
}
117117

118118
@Override
119-
public JobProperty<?> newInstance(@Nonnull StaplerRequest req,
119+
public JobProperty<?> newInstance(@NonNull StaplerRequest req,
120120
JSONObject formData) throws Descriptor.FormException {
121121

122122
GithubProjectProperty tpp = req.bindJSON(

src/main/java/org/jenkinsci/plugins/github/GitHubPlugin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import org.jenkinsci.plugins.github.config.GitHubPluginConfig;
77
import org.jenkinsci.plugins.github.migration.Migrator;
88

9-
import javax.annotation.Nonnull;
9+
import edu.umd.cs.findbugs.annotations.NonNull;
1010

1111
import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;
1212

@@ -49,7 +49,7 @@ public void start() throws Exception {
4949
*
5050
* @return configuration of plugin
5151
*/
52-
@Nonnull
52+
@NonNull
5353
public static GitHubPluginConfig configuration() {
5454
return defaultIfNull(
5555
GitHubPluginConfig.all().get(GitHubPluginConfig.class),

src/main/java/org/jenkinsci/plugins/github/admin/GitHubHookRegisterProblemMonitor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import org.slf4j.Logger;
2121
import org.slf4j.LoggerFactory;
2222

23-
import javax.annotation.Nonnull;
23+
import edu.umd.cs.findbugs.annotations.NonNull;
2424
import javax.inject.Inject;
2525
import java.io.File;
2626
import java.io.IOException;
@@ -166,7 +166,7 @@ public HttpResponse doAct(StaplerRequest req) throws IOException {
166166
@ValidateRepoName
167167
@RequireAdminRights
168168
@RespondWithRedirect
169-
public void doIgnore(@Nonnull @GHRepoName GitHubRepositoryName repo) {
169+
public void doIgnore(@NonNull @GHRepoName GitHubRepositoryName repo) {
170170
if (!ignored.contains(repo)) {
171171
ignored.add(repo);
172172
}
@@ -183,7 +183,7 @@ public void doIgnore(@Nonnull @GHRepoName GitHubRepositoryName repo) {
183183
@ValidateRepoName
184184
@RequireAdminRights
185185
@RespondWithRedirect
186-
public void doDisignore(@Nonnull @GHRepoName GitHubRepositoryName repo) {
186+
public void doDisignore(@NonNull @GHRepoName GitHubRepositoryName repo) {
187187
ignored.remove(repo);
188188
}
189189

0 commit comments

Comments
 (0)