Skip to content

[JENKINS-53322] Remove patched dom4j from Stapler #19973

Description

@jenkins-infra-bot

stapler-jelly currently depends on a patched version¹ of dom4j, the original of which was released thirteen years ago. Current releases support Java 8, etc.

A simple

diff --git a/jelly/pom.xml b/jelly/pom.xml
index 8aa4ec8d7..725f2ba56 100644
--- a/jelly/pom.xml
+++ b/jelly/pom.xml
@@ -32,9 +32,9 @@
       commons-collections
     
     
-      org.jenkins-ci.dom4j
+      org.dom4j
       dom4j
-      1.6.1-jenkins-4
+      2.1.1
     
     
       org.jvnet.maven-jellydoc-plugin

does not work because of an API added to HtmlWriter used by Stapler's HTMLWriterOutput.

To be done:

  • Write a unit test for HTMLWriterOutput demonstrating whatever it is supposed to do.
  • Replace the missing setEnabled call. Perhaps just use Proxy to make a ContentHandler that dynamically switches between XMLWriter and HTMLWriter. That obviates the need for this patch. Close this PR accordingly.
  • File an upstream PR for the static keyword addition from that patch.
  • Update to 2.1.1 or newer. PR should link to this.
  • File an upstream PR for this minor-looking improvement.
  • Determine if this patch is even useful. If so, it can be done via the official getOmitElementCloseSet + setOmitElementCloseSet API.
  • Forget about this patch since JENKINS-13709 is just one of many evil consequences of using maven-plugin.
  • Recheck JENKINS-46616 which I think is not an issue in current library releases.

danielbeck is there some epic or label for issues proposing to switch from forked to official versions of libraries in Jenkins?

¹Using a different GA, no less. Noticed here: causes mayhem for plugins depending on the database plugin.


Originally reported by jglick, imported from: Remove patched dom4j from Stapler
  • assignee: jthompson
  • status: Closed
  • priority: Major
  • component(s): core
  • label(s): dom4j, stapler
  • resolution: Fixed
  • resolved: 2019-09-24T14:39:48+00:00
  • votes: 0
  • watchers: 2
  • imported: 2025-11-24
Raw content of original issue

stapler-jelly currently depends on a patched version¹ of dom4j, the original of which was released thirteen years ago. Current releases support Java 8, etc.

A simple

diff --git a/jelly/pom.xml b/jelly/pom.xml
index 8aa4ec8d7..725f2ba56 100644
--- a/jelly/pom.xml
+++ b/jelly/pom.xml
@@ -32,9 +32,9 @@
       <artifactId>commons-collections</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.jenkins-ci.dom4j</groupId>
+      <groupId>org.dom4j</groupId>
       <artifactId>dom4j</artifactId>
-      <version>1.6.1-jenkins-4</version>
+      <version>2.1.1</version>
     </dependency>
     <dependency><!-- only needed for annotations, hence optional -->
       <groupId>org.jvnet.maven-jellydoc-plugin</groupId>

does not work because of an API added to HtmlWriter used by Stapler's HTMLWriterOutput.

To be done:

  • Write a unit test for HTMLWriterOutput demonstrating whatever it is supposed to do.
  • Replace the missing setEnabled call. Perhaps just use Proxy to make a ContentHandler that dynamically switches between XMLWriter and HTMLWriter. That obviates the need for this patch. Close this PR accordingly.
  • File an upstream PR for the static keyword addition from that patch.
  • Update to 2.1.1 or newer. PR should link to this.
  • File an upstream PR for this minor-looking improvement.
  • Determine if this patch is even useful. If so, it can be done via the official getOmitElementCloseSet + setOmitElementCloseSet API.
  • Forget about this patch since JENKINS-13709 is just one of many evil consequences of using maven-plugin.
  • Recheck JENKINS-46616 which I think is not an issue in current library releases.

danielbeck is there some epic or label for issues proposing to switch from forked to official versions of libraries in Jenkins?

¹Using a different GA, no less. Noticed here: causes mayhem for plugins depending on the database plugin.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions