Project

Profile

Help

Bug #5931

closed

Please do not include outdated xml-apis in the Maven consumable artifact

Added by Olivier Cailloux about 1 year ago. Updated 12 months ago.

Status:
Closed
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
2023-03-21
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
11, 12, trunk
Fix Committed on Branch:
11, 12, trunk
Fixed in Maintenance Release:
Platforms:
Java

Description

The Maven artifact net.sf.saxon:Saxon-HE depends on xml-apis:xml-apis (brought by the transitive dependencies mechanism through org.xmlresolver:org.xmlresolver). I believe that it shouldn’t, for the reason outlined here.

The best fix would be to convince people producing the org.xmlresolver artifact to change this, but meanwhile, you can exclude this dependency from your own artifact.

Thanks for your consideration.

Actions #1

Updated by Michael Kay about 1 year ago

Could you please provide an example of something that exhibits the problem, describing the symptoms of failure, where the problem would disappear if we made the proposed change?

Actions #2

Updated by Olivier Cailloux about 1 year ago

Sure. Import this in Eclipse. Hover over the line “import javax.xml.transform.stream.StreamSource;”. It will say “The package javax.xml.transform.stream is accessible from more than one module: , java.xml” and refuse to compile.

Actions #3

Updated by Michael Kay about 1 year ago

Thanks. I'm not sure any of us have Eclipse installed but I guess we should give it a try. It's also true that we haven't started using modules (partly because we still support Java 8 - we got lots of pushback when we shipped a release that didn't work with Java 8).

Actions #4

Updated by Olivier Cailloux about 1 year ago

Note that I do not think that some of you absolutely need to have Eclipse installed. Reading the provided link could hopefully suffice to convince that this dependency is not a good thing to have.

Also note that the example project also don’t use modules.

Actions #5

Updated by Michael Kay about 1 year ago

  • Assignee set to Norm Tovey-Walsh
  • Priority changed from Low to Normal
Actions #6

Updated by Norm Tovey-Walsh about 1 year ago

Fascinating. Thank you. I recently plowed my way through the muddle of xml-apis.jar and somehow failed to notice that they were simply part of the JDK starting at least with Java 8. blush

Good riddance.

Actions #7

Updated by Norm Tovey-Walsh about 1 year ago

  • Status changed from New to Resolved
  • Applies to branch 11, 12, trunk added
  • Fix Committed on Branch 11, 12, trunk added

I've published XML Resolver 5.1.2 that removes the dependency on xml-apis. I've updated the builds for Saxon 11.x, 12.x, and trunk to use it, and exclude xml-apis for good measure.

Actions #8

Updated by Olivier Cailloux about 1 year ago

Great! Thanks for the prompt update.

Just a minor thing, I’d say that adding exclusions that are unnecessary would obscure your POM for no big gain and be incoherent as you’d then have to exclude every possibly problematic dependency just in case it would in the future pop up in one of your references. Rather exclude only when necessary (and better let the problem visible and solve it in the dependency itself as you just did), I’d say. But it’s possibly a subjective preference. Thanks again anyway.

Actions #9

Updated by Norm Tovey-Walsh about 1 year ago

I meant I excluded it in our build, so that if its absence ever causes a problem, we'll know. I haven't updated the Maven POM to explicitly exclude it.

Actions #10

Updated by Olivier Cailloux about 1 year ago

Perfect, thanks again for the quick reaction.

Actions #11

Updated by O'Neil Delpratt 12 months ago

  • Status changed from Resolved to Closed
  • Fixed in Maintenance Release 12.2 added

Closing out this bug as it has been applied already.

Please register to edit this issue

Also available in: Atom PDF