Skip to content

Commit

Permalink
Replace Jenkins test harness in hpi with Apache commons lang3 plugin
Browse files Browse the repository at this point in the history
jenkinsci/jenkins#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
  • Loading branch information
MarkEWaite committed Dec 18, 2023
1 parent faedd12 commit 55a3de4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pom.xml
Expand Up @@ -22,12 +22,6 @@
<artifactId>jenkins-core</artifactId>
<version>2.277.1</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-test-harness-htmlunit</artifactId>
<version>66.v712ea44bccba</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-step-api</artifactId>
Expand Down Expand Up @@ -56,6 +50,11 @@
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>commons-lang3-api</artifactId>
<version>3.12.0.0</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-cps</artifactId>
Expand Down

0 comments on commit 55a3de4

Please sign in to comment.