1

While migrating a project from java 8 to java 11 using the java module system we noticed two warnings due to used library dom4j (version 2.1.3).

Problem

  1. "Name of automatic module ´dom4j´ is unstable, it is derived from the module´s file name." (Eclipse 2020-09)
  2. "Required filename-based automodule detected: [dom4j-2.1.3.jar]. Please don´t publish this project to a public artifact repository!" (Maven 3.6.0)

Situation

As far i can see the developers of dom4j are aware of this problem: https://github.com/dom4j/dom4j/issues/67

Since the issue is over 1 year old, still open, and the last commit to master branch is 7 month old we wan´t to move away from dom4j (sadly, i really liked dom4j) to a newer library. We realy want to use the new module system of Java and don´t want to ignore those warnings.

Question

Could you recommend a "modern" Java-9 module system aware library for xml processing? We use mainly simple stuff like reading/parsing, writing and pretty printing. An Apache-2.0 License would be nice but is not a requirement.

My resaerch currenly revealed https://github.com/FasterXML/aalto-xml which is Apache-2.0 License and seems to contain a Java 9 Module definition. Could you recomment Aalto or any other library for usage with the java module system?

Reproducability

The problem could easily be reproduced using a simple pom.xml including a dependency to

<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.3.1</version>

together with mavens build plugin

<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
 <release>11</release>
 <encoding>utf-8</encoding>...

and a module-info.java

module dom4jproblem {
  exports mypackage;
  
  requires dom4j;
}
someuser
  • 21
  • 1
  • 2
  • I am not sure if this is an option, but `gradle` has a plugin that can do that for you, though moving to gradle might not be an option at all, I understand. just in case, may be [this](https://stackoverflow.com/questions/63204044/gradle-jigsaw-module-not-found/63457166#63457166) will be a good read. – Eugene Oct 29 '20 at 21:11

0 Answers0