Skip to content

Commit

Permalink
Bump plugin from 4.48 to 4.55 (#174)
Browse files Browse the repository at this point in the history
* plugin 4.52 doesn't support Java 8 anymore, so it has been removed from the CI.
* plugin 4.50 ships with an updated Spotbugs which raises more warnings than before. The code has been tentatively adapted to remove the warnings.

---

Bumps [plugin](https://github.com/jenkinsci/plugin-pom) from 4.48 to 4.55.
- [Release notes](https://github.com/jenkinsci/plugin-pom/releases)
- [Changelog](https://github.com/jenkinsci/plugin-pom/blob/master/CHANGELOG.md)
- [Commits](jenkinsci/plugin-pom@plugin-4.48...plugin-4.55)

---
updated-dependencies:
- dependency-name: org.jenkins-ci.plugins:plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>


---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Ballet <jon@multani.info>
  • Loading branch information
dependabot[bot] and multani committed Feb 17, 2023
1 parent 8b8bc96 commit 02df345
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
3 changes: 1 addition & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* `buildPlugin` step provided by: https://github.com/jenkins-infra/pipeline-library */
buildPlugin(useContainerAgent: true, configurations: [
[platform: 'linux', jdk: '8'],
buildPlugin(useContainerAgent: true, failFast: false, configurations: [
[platform: 'linux', jdk: '11'],
[platform: 'linux', jdk: '17'],
])
6 changes: 2 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.48</version>
<version>4.55</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -36,9 +36,7 @@
<properties>
<revision>0.9.4</revision>
<changelist>-SNAPSHOT</changelist>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<findbugs.failOnError>false</findbugs.failOnError>
<jenkins.version>2.340</jenkins.version>
<jenkins.version>2.361</jenkins.version>
<json-path-assert.version>2.7.0</json-path-assert.version>
</properties>

Expand Down
17 changes: 9 additions & 8 deletions src/main/java/org/jenkinsci/plugins/nomad/NomadApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ private String normalizeJobTemplate(String jobTemplate) {
.post(RequestBody.create(gson.toJson(jobHCL), JSON))
.build();

try (Response response = executeRequest(request);
ResponseBody body = response.body()
) {
JsonObject jobJson = new JsonObject();
try (Response response = executeRequest(request)) {
ResponseBody body = response.body();
if (body != null) {
JsonObject jobJson = new JsonObject();
jobJson.add("Job", gson.fromJson(body.string(), JsonObject.class));
body.close();
return gson.toJson(jobJson);
}
} catch (Exception e) {
Expand Down Expand Up @@ -251,16 +251,17 @@ private boolean isJSON(String source) {
private String checkResponseAndGetBody (Request request) {
String bodyString = "";
try (Response response = executeRequest(request);
ResponseBody responseBody = response.body()
ResponseBody body = response.body()
) {
bodyString = responseBody.string();
if (body != null) {
bodyString = body.string();
}

if (!response.isSuccessful()) {
LOGGER.log(Level.SEVERE, "Request was not successful! Code: "+response.code()+", Body: '"+bodyString+"'"+"URL: "+request.url());
}
} catch (IOException e) {
LOGGER.log(Level.SEVERE, e.getMessage() + "\nRequest:\n" + request);
} catch (NullPointerException e) {
LOGGER.log(Level.SEVERE, "Error: Got no Nomad response." + "\nRequest:\n" + request.toString());
}
return bodyString;
}
Expand Down

0 comments on commit 02df345

Please sign in to comment.