-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add jackson-dataformat-xml
to Jackson 2 API plugin
#82
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I tried adding this here to see if it fixed it on it's own but it didn't, good to know you had the same result
To reproduce the Azure problem, add this on top of the present PR: diff --git a/pom.xml b/pom.xml
index 4eba2d1..7f7b7a1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -67,7 +67,7 @@
<revision>2.12.4</revision>
<changelist>-SNAPSHOT</changelist>
<java.level>8</java.level>
- <jenkins.version>2.222.4</jenkins.version>
+ <jenkins.version>2.300</jenkins.version>
<jackson.version>2.12.3</jackson.version>
<jackson-databind.version>${jackson.version}</jackson-databind.version>
</properties>
@@ -89,8 +89,8 @@
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
- <artifactId>bom-2.222.x</artifactId>
- <version>807.v6d348e44c987</version>
+ <artifactId>bom-2.289.x</artifactId>
+ <version>887.vae9c8ac09ff7</version>
<scope>import</scope>
<type>pom</type>
</dependency> BTW I see the root cause of the problem now, but I don't believe there is a practical solution. Perhaps @jglick would be interested in checking my analysis.
That is then pased to If that If that resulting in
So clearly The use of
which ends up using This is a similar problem as described in JENKINS-58130 (comment):
I'm not sure there is a practical solution here. In the case of e.g. jenkinsci/azure-storage-plugin#194 we are just consuming some upstream Microsoft Azure SDK that ends up calling Jackson to parse XML, so we can't change the way we invoke Jackson. And I can't think of any way to patch Jackson to work around this either. Patching Given the above, I think we have to accept that core will have to bundle Woodstox if we intend to have plugins that use Jackson to parse XML work with Jenkins' architecture. That is basically the status quo, with an ancient version of Woodstox (3.x). If we must do that, then I think we ought to ship the latest version of Woodstox rather than the ancient Woodstox 3.x that we're shipping today. At least that way what |
Sure you can. Just set the CCL before using the Azure SDK. jenkinsci/jira-plugin#353 for example |
Of course, but I don't think that meaningfully changes my analysis. Yes every plugin that either directly or transitively calls Jackson to parse XML could wrap such calls in a Yes we could keep So I think my conclusion from the above remains:
Can you see a flaw in this argument? |
Are any plugins other than
That does not mean they are using it. |
Or why not just offer a patch to |
Indeed. My point isn't that the risk is high. It's that there is no way to calculate the risk.
No, but that doesn't mean other plugins aren't affected. It is a matter of judging risk. If you think the risk is acceptable, then we can keep
Because as I wrote above:
|
Possibly others |
As far as I can see the required API's are in the JDK? I've submitted a patch to Jackson: FasterXML/jackson-dataformat-xml#480 I can't see a nice way to plug this into the Azure SDK though, it's setup to handle all serialisation there, maybe they can give us a knob to tune though. |
Ah yes, I missed that. |
With my latest commit to this PR, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine. I am not a maintainer.
@jvz and @oleg-nenashev from memory |
If you need a release soon, ask Oleg. Otherwise, I can handle it in a couple days. |
CC @batmat whose team is currently looking after this plugin at CloudBees. |
Also @dwnusbaum is registered in RPU. |
I filed jenkins-infra/repository-permissions-updater#2014 to give release permissions to the appropriate people. |
Adds
jackson-dataformat-xml
to the Jackson 2 API plugin for the benefit of other plugins that need it and want to get it through the Jackson 2 API plugin. This also bundles the following two new transitive dependencies:These are up-to-date versions of StAX 2 (which the Java Platform does not provide) and Woodstox (the recommended StAX implementation for
jackson-dataformat-xml
.I included a new integration test with
RealJenkinsRule
that works against Jenkins 2.297 and earlier, as well as tip-of-trunk with jenkinsci/jenkins#5604. Without jenkinsci/jenkins#5604, the test fails on tip-of-trunk with the same error as in jenkinsci/azure-storage-plugin#194. So somehow we end up relying on the old version of Woodstox (3.x) from Jenkins core, even thoughjackson-dataformat-xml
depends on a recent version of Woodstox as a compile-time dependency. I am not sure why. The test passes with regularJenkinsRule
, so this must be a classpath issue withjenkins.war
. This would be a useful starting point for anyone who is investigating removing Woodstox from Jenkins core.CC @timja