Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Maybe] Add removePackage feature to deal with split-packages in JDK Modules (for example xerces:xercesImpl) #140

Open
wardeneta opened this issue Sep 14, 2024 · 1 comment
Labels
a:enhancement New feature or request

Comments

@wardeneta
Copy link

Hello, I tried your plugin and there was a problem with this library

implementation 'xerces:xercesImpl:2.12.2'

which contains the package org.w3c.dom, which is part of jdk.xml.dom. how to solve it in this case? Thanks

@jjohannes
Copy link
Member

jjohannes commented Sep 21, 2024

Hi, I am afraid this can't be solved with the plugin right now.

As you have a conflict with a Module in the JDK itself – jdk.xml.dom – you can't use the mergeJar functionality, as you cannot modify a Module of the JDK itself.

I think this should really be solved in xerces. It is this issue: https://issues.apache.org/jira/browse/XERCESJ-1689

Looks like it was fixed months ago, but never released. 😞


We could think about adding a new functionality to this plugin that allows you to completely remove a package from a Jar. As we already do filtering of Jar entries and allow to ignore service providers:

extraJavaModuleInfo {               
    module("groovy-all-2.4.15.jar", "groovy.all", "2.4.15") {
       ignoreServiceProvider("org.codehaus.groovy.source.Extensions")
    }
}

We could add something similar to remove a package:

extraJavaModuleInfo {               
    module("xerces:xercesImpl", "xerces.impl)") {
       removePackage("org.w3c.dom.html") // THIS IS A MOCKUP, we do not have this yet
    }
}

I am would be open for contributions.

@jjohannes jjohannes changed the title xercesImpl [Maybe] Add removePackage feature to deal with split-packages in JDK Modules (for example xerces:xercesImpl) Sep 21, 2024
@jjohannes jjohannes added the a:enhancement New feature or request label Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants