From 1d031b07e01172f44aec9284b5ad963939bbf642 Mon Sep 17 00:00:00 2001 From: Heidi Vanparys Date: Tue, 9 Dec 2025 17:14:32 +0100 Subject: [PATCH] Exclude legacy XML API dependencies and use java.xml module instead 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, ". 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 https://github.com/apache/commons-digester/commit/05b3ffc988d8dad0db461b fb35598a244e32f4f6). --- core/pom.xml | 7 ----- pom.xml | 74 +++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 71 insertions(+), 10 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index 3bc5b6a669b7..863b81cc28bb 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -563,13 +563,6 @@ org.owasp.esapi esapi - 2.5.4.0 - - - log4j - log4j - - org.xmlunit diff --git a/pom.xml b/pom.xml index 2c8b46816bd4..413df043f312 100644 --- a/pom.xml +++ b/pom.xml @@ -266,6 +266,14 @@ + + + xml-apis:xml-apis + xml-apis:xml-apis-ext + xml-apis:xmlParserAPIs + xerces:xmlParserAPIs + + 3.8.3 @@ -482,6 +490,16 @@ org.apache.xmlgraphics fop ${fop.version} + + + xml-apis + xml-apis + + + xml-apis + xml-apis-ext + + @@ -522,7 +540,7 @@ commons-digester commons-digester - 1.6 + 1.8.1 org.apache.commons @@ -621,11 +639,28 @@ xerces xercesImpl 2.12.2 + + + xml-apis + xml-apis + + + xml-apis + xml-apis-ext + + xml-apis xml-apis 1.4.01 + provided + + + xml-apis + xml-apis-ext + 1.3.04 + provided @@ -850,7 +885,7 @@ jaxen jaxen - 1.1.4 + 1.2.0 org.quartz-scheduler @@ -859,6 +894,25 @@ + + org.owasp.esapi + esapi + 2.5.4.0 + + + log4j + log4j + + + xml-apis + xml-apis + + + xml-apis + xml-apis-ext + + + com.github.mwiede jsch @@ -888,6 +942,14 @@ log4j log4j + + xml-apis + xml-apis + + + xml-apis + xml-apis-ext + @@ -1196,7 +1258,13 @@ xom xom - 1.1 + 1.3.9 + + + xml-apis + xml-apis + + org.xhtmlrenderer