In my Grails project, I used library A. One of A's dependencies is B. In B jar, there's a package (named C) that I want to exclude from my project (because it duplicates an existing package in JDK and causes error when starting up the application). But I don't know the correct syntax to do this. I tried the below codes but it does not work
dependencies {
runtime ('A-library') {
excludes(<what-I-should-write-here>)
}
}
Could you please help me on this? Thank you so much
You can only include/exclude B completely, you can't include/exclude certain packages of B. To achieve your goal you would need to find (or create) a modified version of B that has the duplicate packages removed. Then change your BuildConfig.groovy to:
dependencies {
runtime ('A-library') {
excludes('B-library')
}
runtime 'B-library-with-duplicate-packages-excluded'
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With