Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Jenkins test harness from hpi file #110

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MarkEWaite
Copy link

Replace Jenkins test harness in hpi with Apache commons lang3 plugin

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:

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

Also removes duplicate dependency declarations.

Testing done

Automated tests pass.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes

Resolve a maven warning by not declaring a test dependency when a compile
dependency is already declared.
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
@MarkEWaite MarkEWaite changed the title Replace Jenkins test harness in hpi with Apache commons lang3 plugin Remove Jenkins test harness from hpi file Dec 18, 2023
@MarkEWaite
Copy link
Author

MarkEWaite commented Jan 5, 2024

@gabo89 this plugin will not load in Jenkins 2.434 and later until a new release is created with the contents of this pull request

A pre-release is available from https://ci.jenkins.io/job/Plugins/job/container-image-link-plugin/job/PR-110/lastSuccessfulBuild/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant