-
Notifications
You must be signed in to change notification settings - Fork 399
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
Gigantic jar when using Gradle 8.x #910
Comments
When we try to exclude, it has no effect:
results in the contents shown in these three screenshots: |
Was able to work around this by creating a repo that only has the bouncy-castle dependencies, shadowing and publishing that, and use it in the original repo. |
Forgot to mention that minimize() has no effect. |
I believe this occurs when The manual recommends adding dependencies to the shadow(gradleApi())
shadow(localGroovy()) but this had no effect in my project. It used to work with Shadow 6.1.0 and Gradle 6.8.3 (I found I didn't even need the I worked around it by setting an include on the tasks.shadowJar {
include(
"com/mycompany/**/*",
"my-dependency-*",
"META-INF/gradle-plugins/com.mycompany.*",
"META-INF/my-project.kotlin_module",
"META-INF/my-dependency.kotlin_module"
)
} to only include the project's own classes and the one dependency I wanted to bundle. |
Same problem here, using Gradle 8.9 and the @jimshowalter's workaround would work, but it's painful of course. I noticed that the Problem does not appear on Gradle < 8, and also the old jonrengelman plugin works fine even with Gradle 8 (but with it's own limitations, of course). @Goooler Can you have a look at this one of these days? That would be fantastic, as it's currently blocking us from using the new plugin. Thanks!! |
Fixed in #948. |
Wow, that's great! Thank you! |
Please check the User Guide before submitting "how do I do 'x'?" questions!
Shadow Version
8.1.1
Gradle Version
8.6
Expected Behavior
Should only need to shadow bouncycastle dependencies, and resulting jar should be small, with just bouncycastle relocated.
Actual Behavior
Without adding a number of other dependencies, the resulting jar was not usable by our code, which failed at runtime with missing-class exceptions.
See comment in shadow-bad's dependency.gradle that starts with "// If this dependencies{} block is commented out".
shadow-good.zip
shadow-bad.zip
The text was updated successfully, but these errors were encountered: