Skip to content

The best way to fix duplicate packages? #215

@stewue

Description

@stewue

Thanks for providing such a great plugin to support Java Modules for libraries which do not properly support Java Modules. I have a question on that is the best solution for an issue which I already had serveral times.

In my project I have two (transitive) dependencies to org.apache.tomcat.embed:tomcat-embed-el and jakarta.el:jakarta.el-api. Both export the package jakarta.el. At the application startup I get errors such as module XXXXXXX reads package jakarta.el from both org.apache.tomcat.embed.el and jakarta.el. My current solution is to substitute the dependency jakarta.el:jakarta.el-api with org.apache.tomcat.embed:tomcat-embed-el. Additionally I must redefine the module definition for some other dependencies. I just simply copy the existing module info definition and replace requires jakarta.el with requires org.apache.tomcat.embed.el. It works but is a bit ugly as many lines are copied.

I also tried the removePackage(...) feature. If I use preserveExisting() and removePackage("jakarta.el") for org.apache.tomcat.embed.el, the package was removed but the export still exists. I still get the error above at the application startup.

Is there a better option which I missed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions