Java 11 Module Issue: xpp3 Dependency in xmppserver Provides Duplicate QName Class

Hi everyone,

I’ve encountered a dependency conflict in the xmppserver module of the Openfire project and have a proposed fix. I would appreciate any feedback.

Issue Details

The xmppserver project currently declares the following dependency:

<dependency>
    <groupId>xpp3</groupId>
    <artifactId>xpp3</artifactId>
    <version>1.1.4c</version>
</dependency>

This dependency also includes the class javax.xml.namespace.QName, which is already provided by Java’s java.xml module. I’m developing a plugin for Openfire that uses this class, and I receive the following error:

The package javax.xml.namespace is accessible from more than one module: <unnamed>, java.xml

I’ve verified that replacing the current dependency with a modified version resolves the issue:

<dependency>
    <groupId>org.codelibs</groupId>
    <artifactId>xpp3</artifactId>
    <version>1.1.4c.0</version>
</dependency>

The content of the org.codelibs:xpp3:1.1.4c.0 library is identical to the original, except that it does not include the conflicting javax.xml.namespace.QName class.

Steps to Reproduce

  • Clone the Openfire repository:
  • Import the project into Eclipse.
  • Create an Openfire plugin and import the class javax.xml.namespace.QName.
  • Observe the error in Eclipse:
    "The package javax.xml.namespace is accessible from more than one module: <unnamed>, java.xml"
  • Replace the dependency in the xmppserver module’s POM with the org.codelibs:xpp3:1.1.4c.0 version.
  • Rebuild the projects and verify that the error no longer occurs.

Additional Context

The currently included artifact is from 2007, and the original xpp3 project appears to be dead. With Java 11 and beyond, anyone developing a plugin that uses javax.xml.namespace.QName will encounter this issue. Switching to the org.codelibs might not be a proper fix, but it is a fix.

I am not sure if this fix aligns with the project’s dependency management strategy or if there are any concerns with switching to the org.codelibs version. Any feedback on this approach would be greatly appreciated.

Best regards,
Mihai