Skip to content

Conversation

@heidivanparys
Copy link
Contributor

@heidivanparys heidivanparys commented Dec 9, 2025

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

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • API Changes are identified in commit messages
  • Testing provided for features or enhancements using automatic tests
  • User documentation provided for new features or enhancements in manual
  • Build documentation provided for development instructions in README.md files
  • Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

@heidivanparys
Copy link
Contributor Author

I no longer have compile errors in my environment (see also #9118) after applying these changes. But extra checks and feedback would be great.

@heidivanparys
Copy link
Contributor Author

(close and reopen pull request to try to trigger the checks again)

@heidivanparys heidivanparys reopened this Dec 10, 2025
@juanluisrp juanluisrp added the dependencies Pull requests that update a dependency file label Dec 11, 2025
@juanluisrp juanluisrp added this to the 4.4.10 milestone Dec 11, 2025
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).
@heidivanparys
Copy link
Contributor Author

Changes made from 0610063 to 1d031b0 (force push): moved the dependency exclusions to the pom.xml of the parent project. This way, the following calls all succeed:

mvn -pl common validate
mvn -pl cachingxslt validate
mvn -pl sde validate
mvn -pl domain validate
mvn -pl oaipmh validate
mvn -pl events validate
mvn -pl core validate
mvn -pl listeners validate
mvn -pl schemas validate
mvn -pl csw-server validate
mvn -pl harvesters validate
mvn -pl healthmonitor validate
mvn -pl services validate
mvn -pl wro4j validate
mvn -pl inspire-atom validate
mvn -pl doi validate
mvn -pl es validate
mvn -pl release validate
mvn -pl workers validate
mvn -pl messaging validate
mvn -pl estest validate
mvn -pl index validate
mvn -pl datastorages validate
mvn -pl plugins validate
mvn -pl translationproviders validate
mvn -pl auditable validate
mvn -P with-doc -pl docs validate
mvn -pl slave validate
mvn -pl schemas-test validate
mvn -pl web-ui validate
mvn -pl web validate
mvn -P jmeter -pl jmeter validate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compile errors when importing the project(s) in Eclipse

2 participants