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

Is there easy way to exclude other services file but keep specific one? #851

Open
wangyinsheng opened this issue Mar 25, 2023 · 0 comments

Comments

@wangyinsheng
Copy link

Please check the User Guide before submitting "how do I do 'x'?" questions!

Shadow Version

7.0.0

Gradle Version

7.6

Expected Behavior

The third-party jars contains many services files like META-INF/services/XXX , and my project has an services file META-INF/services/AAA. Is there easy way to exclude all services files in third-party jars, but keep services file of my projcet META-INF/services/AAA?

Actual Behavior

When I use the follow script, It will exculde all services file

shadowJar {
  mergeServiceFiles {
        exclude "META-INF/services/**"
        include "META-INF/services/AAA"
  }
}

I must exclude one by one as follow script, then it works as I expected, but the third-party jars contains too many services files, and need a new exclude script if introduce another third-party jars

shadowJar {
  mergeServiceFiles {
        exclude "META-INF/services/BBB"
        exclude "META-INF/services/CCC"
        exclude "META-INF/services/DDD"
        exclude "META-INF/services/...."
        exclude "META-INF/services/XXX"
  }
}

Thanks for any suggestion

Gradle Build Script(s)

Content of Shadow JAR (jar tf <jar file> - post link to GIST if too long)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant