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

[Enhancement]: Shrink size of core-jar / Rethink shading #8612

Open
AB-xdev opened this issue May 7, 2024 · 0 comments
Open

[Enhancement]: Shrink size of core-jar / Rethink shading #8612

AB-xdev opened this issue May 7, 2024 · 0 comments

Comments

@AB-xdev
Copy link
Contributor

AB-xdev commented May 7, 2024

Module

Core

Proposal

The testcontainers jar file currently has a size of a whopping 17MB (packed; unpacked 34MB), making it by far one of the biggest maven dependencies I know of.

Most of the size (>97%; 33MB) seems to come from shaded artifacts inside org.testcontainers.shaded.

A full list of disadvantages of shading can be found in JLBP-18.

I think the jar could be a lot smaller. Here a few ways how this could be tackled:

  • Check if all the shaded dependencies are required in the core module in the first place. I check the core module and couldn't find any class that implements: org.hamcrest, org.checkerframework, org.bouncycastle or org.awaitability.
    There are also other libraries that could be easily replaced, e.g. guava as it's only used in a few places and uses nowadays standard java stuff. Removing these 5 libs alone would shrink the lib by 23MB or 67% alone.
  • Maybe don't use shading at all and publish a bom that contains the exact versions of the required dependencies, that way there should also be no dependency conflicts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant