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

Bundle XML pull parser for forward compatibility with jenkinsci/jenkins#8503 #246

Merged
merged 1 commit into from Sep 18, 2023

Conversation

basil
Copy link
Member

@basil basil commented Sep 18, 2023

Without dropping support for existing cores (where this library will simply be ignored in favor of core's copy), add forward compatibility for jenkinsci/jenkins#8503 by bundling XML Pull Parser 3rd Edition within this plugin's HPI file rather than relying on core's copy, thereby enabling us to remove this library from core.

Testing done

I ran a build with the TestNG plugin and jenkinsci/jenkins#8503, confirming that the following exception was now thrown (as expected):

13:32:33 java.lang.NoClassDefFoundError: org/xmlpull/v1/XmlPullParserException
13:32:33 	at hudson.plugins.testng.TestNGTestResultBuildAction.loadResults(TestNGTestResultBuildAction.java:128)
13:32:33 	at hudson.plugins.testng.Publisher.perform(Publisher.java:252)
13:32:33 	at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
13:32:33 	at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80)
13:32:33 	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
13:32:33 	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:818)
13:32:33 	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:767)
13:32:33 	at hudson.model.Build$BuildExecution.post2(Build.java:179)
13:32:33 	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:711)
13:32:33 	at hudson.model.Run.execute(Run.java:1920)
13:32:33 	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
13:32:33 	at hudson.model.ResourceController.execute(ResourceController.java:101)
13:32:33 	at hudson.model.Executor.run(Executor.java:442)
13:32:33 Caused by: java.lang.ClassNotFoundException: org.xmlpull.v1.XmlPullParserException
13:32:33 	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
13:32:33 	at jenkins.util.URLClassLoader2.findClass(URLClassLoader2.java:35)
13:32:33 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593)
13:32:33 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
13:32:33 	... 13 more

I also verified that this exception went away after the changes in this PR and that XML Pull Parser 3rd edition was bundled in this plugin's HPI:

[INFO] Assembling webapp testng-plugin in /home/basil/src/jenkinsci/testng-plugin-plugin/target/testng-plugin
[INFO] Bundling direct dependency mxparser-1.2.2.jar
[WARNING] Bundling transitive dependency xmlpull-1.1.3.1.jar (via mxparser)

@MarkEWaite MarkEWaite changed the title Forward compatibility with jenkinsci/jenkins#8503 Bundle XML pull parser for forward compatibility with jenkinsci/jenkins#8503 Sep 18, 2023
@MarkEWaite MarkEWaite merged commit 51ed3da into jenkinsci:master Sep 18, 2023
17 checks passed
@basil basil deleted the xmlpull branch September 18, 2023 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer Affects developers and maintainers
Projects
None yet
2 participants