From 55a3de46e8f650c3b0255da995e3021dd40bbb8e Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Sun, 17 Dec 2023 22:17:58 -0700 Subject: [PATCH] Replace Jenkins test harness in hpi with Apache commons lang3 plugin 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 90% smaller. Before this change, the plugin hpi file had the following contents: 1680 images/docker.svg 765 META-INF/MANIFEST.MF 84 META-INF/maven/io.jenkins.plugins/container-image-link/pom.properties 5342 META-INF/maven/io.jenkins.plugins/container-image-link/pom.xml 327135 WEB-INF/lib/commons-io-2.11.0.jar 307305 WEB-INF/lib/commons-net-3.8.0.jar 13633 WEB-INF/lib/container-image-link.jar 9277 WEB-INF/lib/crypto-util-1.5.jar 98115 WEB-INF/lib/dec-0.1.2.jar 10579074 WEB-INF/lib/jenkins-test-harness-htmlunit-66.v712ea44bccba.jar 65728 WEB-INF/lib/salvation2-3.0.0.jar 276420 WEB-INF/lib/serializer-2.7.2.jar 220536 WEB-INF/lib/xml-apis-1.4.01.jar 6546 WEB-INF/licenses.xml After this change, the plugin hpi file has the following contents: 1680 images/docker.svg 816 META-INF/MANIFEST.MF 83 META-INF/maven/io.jenkins.plugins/container-image-link/pom.properties 5320 META-INF/maven/io.jenkins.plugins/container-image-link/pom.xml 327135 WEB-INF/lib/commons-io-2.11.0.jar 13661 WEB-INF/lib/container-image-link.jar 9277 WEB-INF/lib/crypto-util-1.5.jar 3444 WEB-INF/licenses.xml --- pom.xml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index f7b4d73..1119fe9 100644 --- a/pom.xml +++ b/pom.xml @@ -22,12 +22,6 @@ jenkins-core 2.277.1 - - org.jenkins-ci.main - jenkins-test-harness-htmlunit - 66.v712ea44bccba - compile - org.jenkins-ci.plugins.workflow workflow-step-api @@ -56,6 +50,11 @@ commons-io 2.11.0 + + io.jenkins.plugins + commons-lang3-api + 3.12.0.0 + org.jenkins-ci.plugins.workflow workflow-cps