From 570f0dffbd093a20c016b41c0f19f79926d25fca Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Sun, 17 Dec 2023 22:51:21 -0700 Subject: [PATCH] Require Jenkins 2.361.4 or newer and Java 11 Also removes Jenkins test harness from the plugin packaging DOES NOT FIX THE INCORRECT MODIFICATION OF ARTIFACT ID https://github.com/jenkinsci/itms-for-jira-plugin/pull/1 needs partial revert to restore original artifact ID and package ID. Remove Jenkins test harness HTMLUnit from the plugin hpi file https://github.com/jenkinsci/jenkins/pull/8714 included in Jenkins 2.434 and later will refuse to load a plugin that includes the Jenkins test harness. The Jenkins test harness causes unexpected failures when it is included in a Jenkins plugin. Refer to the following issue reports for examples: * https://issues.jenkins.io/browse/JENKINS-65650 * https://issues.jenkins.io/browse/JENKINS-66060 * https://issues.jenkins.io/browse/JENKINS-72353 The additional benefit of the change is that it makes the plugin hpi file over 80% smaller. --- pom.xml | 40 ++++++++++--------- .../ifdtms/CucumberGlobalConfiguration.java | 4 +- .../plugins/ifdtms/CucumberPostBuild.java | 4 +- .../plugins/ifdtms/rest/RequestApi.java | 14 +++---- 4 files changed, 32 insertions(+), 30 deletions(-) diff --git a/pom.xml b/pom.xml index 90bd1d2..04b30c3 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.jenkins-ci.plugins plugin - 3.43 + 4.76 @@ -18,11 +18,8 @@ 1.29 -SNAPSHOT - 2.138.4 - 8 + 2.361.4 false - 2.66 - 3.2 @@ -31,7 +28,7 @@ - scm:git:git://github.com/jenkinsci/${project.artifactId}-plugin.git + scm:git:https://github.com/jenkinsci/${project.artifactId}-plugin.git scm:git:git@github.com:jenkinsci/${project.artifactId}-plugin.git https://github.com/jenkinsci/${project.artifactId}-plugin ${scmTag} @@ -60,37 +57,42 @@ - - org.jenkins-ci.main - jenkins-test-harness-htmlunit - 2.31-2 - compile + + io.jenkins.plugins + commons-lang3-api + + + org.jenkins-ci.plugins + apache-httpcomponents-client-4-api org.jenkins-ci.plugins structs - 1.17 org.jenkins-ci.plugins.workflow workflow-step-api - 2.19 org.jenkins-ci.plugins.workflow workflow-api - 2.34 org.jenkins-ci.plugins script-security - 1.56 - - - junit - junit + + + + io.jenkins.tools.bom + bom-2.361.x + 2102.v854b_fec19c92 + import + pom + + + diff --git a/src/main/java/org/jenkins_cli/plugins/ifdtms/CucumberGlobalConfiguration.java b/src/main/java/org/jenkins_cli/plugins/ifdtms/CucumberGlobalConfiguration.java index bc86536..0334547 100644 --- a/src/main/java/org/jenkins_cli/plugins/ifdtms/CucumberGlobalConfiguration.java +++ b/src/main/java/org/jenkins_cli/plugins/ifdtms/CucumberGlobalConfiguration.java @@ -1,6 +1,6 @@ package org.jenkins_cli.plugins.ifdtms; -import hidden.jth.org.apache.http.HttpStatus; +import org.apache.http.HttpStatus; import hudson.Extension; import hudson.model.AbstractProject; import hudson.tasks.BuildStepDescriptor; @@ -205,4 +205,4 @@ public String getToken() { public AuthenticationInfo getAuthenticationInfo() { return authenticationInfo; } -} \ No newline at end of file +} diff --git a/src/main/java/org/jenkins_cli/plugins/ifdtms/CucumberPostBuild.java b/src/main/java/org/jenkins_cli/plugins/ifdtms/CucumberPostBuild.java index 33a0177..0e28d55 100644 --- a/src/main/java/org/jenkins_cli/plugins/ifdtms/CucumberPostBuild.java +++ b/src/main/java/org/jenkins_cli/plugins/ifdtms/CucumberPostBuild.java @@ -1,6 +1,6 @@ package org.jenkins_cli.plugins.ifdtms; -import hidden.jth.org.apache.http.HttpStatus; +import org.apache.http.HttpStatus; import hudson.FilePath; import hudson.Launcher; import hudson.model.AbstractBuild; @@ -169,4 +169,4 @@ public String getItmsCycleName() { public String getJiraProjectKey() { return jiraProjectKey; } -} \ No newline at end of file +} diff --git a/src/main/java/org/jenkins_cli/plugins/ifdtms/rest/RequestApi.java b/src/main/java/org/jenkins_cli/plugins/ifdtms/rest/RequestApi.java index a40bf8b..fd2072f 100644 --- a/src/main/java/org/jenkins_cli/plugins/ifdtms/rest/RequestApi.java +++ b/src/main/java/org/jenkins_cli/plugins/ifdtms/rest/RequestApi.java @@ -1,11 +1,11 @@ package org.jenkins_cli.plugins.ifdtms.rest; -import hidden.jth.org.apache.http.HttpEntity; -import hidden.jth.org.apache.http.HttpResponse; -import hidden.jth.org.apache.http.client.methods.HttpPost; -import hidden.jth.org.apache.http.entity.StringEntity; -import hidden.jth.org.apache.http.impl.client.CloseableHttpClient; -import hidden.jth.org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClientBuilder; import net.sf.json.JSONObject; import java.io.*; @@ -165,4 +165,4 @@ public StandardResponse sendReportToITMS(String baseUrl, String token, Map