Exclude legacy XML API dependencies and use java.xml module instead #9119
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #9118
Java 9 and higher provide the standard XML APIs (javax.xml.parsers, org.w3c.dom, org.xml.sax, etc.) in the java.xml module. Several dependencies in the project depended directly or transitively on older versions of these APIs via artifacts such as xml-apis:xml-apis, xml-apis:xml-apis-ext and xerces:xmlParserAPIs. When both the JDK and a dependency define the same package, certain compilers, especially the Eclipse Java Compiler (ECJ), fail with errors such as
X is accessible from more than one module: javax.xml, <unnamed>.Ensure that Maven does not include the legacy artifacts xml-apis:xml-apis, xml-apis:xml-apis-ext, xml-apis:xmlParserAPIs or xerces:xmlParserAPIs; but relies on the java.xml module instead (GeoNetwork requires at least Java 11).
Update xom:xom from 1.1 to 1.3.9, which no longer bundles org.w3c.dom classes and improves compatibility with more JDK versions (see https://xom.nu/history.html).
Update jaxen:jaxen from to 1.1.4 to 1.2.0, which no longer bundles org.w3c.dom classes (see
https://www.cafeconleche.org/jaxen/releases.html).
Update commons-digester:commons-digester from 1.6 to 1.8.1, which marks xml-apis as provided instead of compile (see
apache/commons-digester@05b3ffc988d8dad0db461b fb35598a244e32f4f6).
Checklist
mainbranch, backports managed with labelREADME.mdfilespom.xmldependency management. Update build documentation with intended library use and library tutorials or documentation