Skip to content

Commit

Permalink
Remove Jenkins test harness HTMLUnit from the plugin hpi file
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 80% smaller.

Before this change, the plugin hpi file had the following contents:

  1136 META-INF/MANIFEST.MF
    73 META-INF/maven/org.jenkins-ci.plugins/applitools-eyes/pom.properties
  3153 META-INF/maven/org.jenkins-ci.plugins/applitools-eyes/pom.xml
 34814 WEB-INF/lib/applitools-eyes.jar
353793 WEB-INF/lib/commons-codec-1.15.jar
588337 WEB-INF/lib/commons-collections-3.2.2.jar
327135 WEB-INF/lib/commons-io-2.11.0.jar
434678 WEB-INF/lib/commons-lang3-3.4.jar
380196 WEB-INF/lib/cssparser-0.9.16.jar
767140 WEB-INF/lib/httpclient-4.5.6.jar
326356 WEB-INF/lib/httpcore-4.4.10.jar
4079701 WEB-INF/lib/jenkins-test-harness-htmlunit-2.18-1.jar
108240 WEB-INF/lib/jetty-io-9.2.12.v20150709.jar
357855 WEB-INF/lib/jetty-util-9.2.12.v20150709.jar
125315 WEB-INF/lib/nekohtml-1.9.22.jar
 15808 WEB-INF/lib/sac-1.3.jar
276420 WEB-INF/lib/serializer-2.7.2.jar
 43776 WEB-INF/lib/websocket-api-9.2.12.v20150709.jar
 36264 WEB-INF/lib/websocket-client-9.2.12.v20150709.jar
179845 WEB-INF/lib/websocket-common-9.2.12.v20150709.jar
3154938 WEB-INF/lib/xalan-2.7.2.jar
1367760 WEB-INF/lib/xercesImpl-2.11.0.jar
220536 WEB-INF/lib/xml-apis-1.4.01.jar
 10963 WEB-INF/licenses.xml

After this change, the plugin hpi file has the following contents:

  1136 META-INF/MANIFEST.MF
    73 META-INF/maven/org.jenkins-ci.plugins/applitools-eyes/pom.properties
  2951 META-INF/maven/org.jenkins-ci.plugins/applitools-eyes/pom.xml
 34479 WEB-INF/lib/applitools-eyes.jar
353793 WEB-INF/lib/commons-codec-1.15.jar
767140 WEB-INF/lib/httpclient-4.5.6.jar
326356 WEB-INF/lib/httpcore-4.4.10.jar
  1814 WEB-INF/licenses.xml
  • Loading branch information
MarkEWaite committed Dec 18, 2023
1 parent 4314711 commit 00bab0e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
6 changes: 0 additions & 6 deletions pom.xml
Expand Up @@ -72,12 +72,6 @@
<version>${plugins.job-dsl.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>jenkins-test-harness-htmlunit</artifactId>
<version>2.18-1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/applitools/jenkins/ApplitoolsCommon.java
@@ -1,10 +1,10 @@
package com.applitools.jenkins;

import hidden.jth.org.apache.http.client.methods.HttpDelete;
import hidden.jth.org.apache.http.client.methods.HttpUriRequest;
import hidden.jth.org.apache.http.client.utils.URIBuilder;
import hidden.jth.org.apache.http.impl.client.HttpClientBuilder;
import hidden.jth.org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.client.HttpClient;
import hudson.model.JobProperty;
import hudson.model.Run;
import hudson.model.TaskListener;
Expand Down

0 comments on commit 00bab0e

Please sign in to comment.