Bug #5931
closedPlease do not include outdated xml-apis in the Maven consumable artifact
0%
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.
Updated by Michael Kay almost 2 years 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?
Updated by Olivier Cailloux almost 2 years 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.
Updated by Michael Kay almost 2 years 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).
Updated by Olivier Cailloux almost 2 years 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.
Updated by Michael Kay almost 2 years ago
- Assignee set to Norm Tovey-Walsh
- Priority changed from Low to Normal
Updated by Norm Tovey-Walsh almost 2 years 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.
Updated by Norm Tovey-Walsh almost 2 years 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.
Updated by Olivier Cailloux almost 2 years 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.
Updated by Norm Tovey-Walsh over 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.
Updated by Olivier Cailloux over 1 year ago
Perfect, thanks again for the quick reaction.
Updated by O'Neil Delpratt over 1 year 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