How to exclude a specific jar dependency package in a Grails project?

In my Grails project, I used library A. One of the dependencies of A is B. There is a package (named C) in the B jar that I want to exclude from my project (since it duplicates an existing package in the JDK and causes an error when the application starts). But I do not know the correct syntax for this. I tried the codes below, but it does not work.

dependencies {  
     runtime ('A-library') {  
            excludes(<what-I-should-write-here>)  
     }
}

Could you help me with this? Thank you very much.

+3
source share
2 answers

, . jar ( ), . , , , , , .

+4

/ B , / B. , ( ) B, . BuildConfig.groovy :

dependencies {  
     runtime ('A-library') {  
            excludes('B-library')  
     }
     runtime 'B-library-with-duplicate-packages-excluded'
}
+5

All Articles