Skip to content

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

Description

@AB-xdev

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions