[JIRA] (JENKINS-53322) Remove patched dom4j from Stapler

6 views
Skip to first unread message

jglick@cloudbees.com (JIRA)

unread,
Aug 29, 2018, 9:58:03 AM8/29/18
to jenkinsc...@googlegroups.com
Jesse Glick created an issue
 
Jenkins / Task JENKINS-53322
Remove patched dom4j from Stapler
Issue Type: Task Task
Assignee: Unassigned
Components: core
Created: 2018-08-29 13:57
Labels: stapler dom4j
Priority: Major Major
Reporter: Jesse Glick

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.

Daniel Beck 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.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

dbeck@cloudbees.com (JIRA)

unread,
Aug 29, 2018, 10:33:01 AM8/29/18
to jenkinsc...@googlegroups.com

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

No such previous effort I'm aware of.

jthompson@cloudbees.com (JIRA)

unread,
Jun 24, 2019, 6:01:02 PM6/24/19
to jenkinsc...@googlegroups.com
Jeff Thompson assigned an issue to Jeff Thompson
 
Change By: Jeff Thompson
Assignee: Jeff Thompson

jthompson@cloudbees.com (JIRA)

unread,
Jun 25, 2019, 6:06:01 PM6/25/19
to jenkinsc...@googlegroups.com
Jeff Thompson commented on Task JENKINS-53322
 
Re: Remove patched dom4j from Stapler

I've been working on this one for a while, compiling different libraries and plugins and running tests and checks. The specific tasks or conclusions I've found are a little different from those originally reported, but the overview remains the same. The forked dom4j version we use is ancient and really isn't necessary. We can get rid of it with a relatively few, independent tweaks. That will get us on a better footing.

I'll start pushing a few PRs to various components to prepare them. Once we actually make the switch there are a few other places we can clean up.

jthompson@cloudbees.com (JIRA)

unread,
Jun 27, 2019, 5:10:02 PM6/27/19
to jenkinsc...@googlegroups.com

PR in Stapler to change to standard dom4j: https://github.com/stapler/stapler/pull/164

Enablement PR in Jenkins to old or new to work fine: https://github.com/jenkinsci/jenkins/pull/4089

ec2-plugin PR to enable old or new to work fine: https://github.com/jenkinsci/ec2-plugin/pull/372 (Already merged)

Additional PRs to come later to include the new versions.

jthompson@cloudbees.com (JIRA)

unread,
Aug 20, 2019, 2:24:02 PM8/20/19
to jenkinsc...@googlegroups.com

Stapler version 1.258 was released on 19 August 2019 containing changes to move to the standard dom4j library.

Jenkins PR https://github.com/jenkinsci/jenkins/pull/4130 depends upon that version and removes dependency on the forked library. This PR is up for review.

dbeck@cloudbees.com (JIRA)

unread,
Sep 24, 2019, 10:40:03 AM9/24/19
to jenkinsc...@googlegroups.com
Daniel Beck closed an issue as Fixed
 
Change By: Daniel Beck
Status: Open Closed
Resolution: Fixed
Released As: jenkins-2.194
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages