testcontainers / testcontainers/testcontainers-java

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

Aperta
#8,612 0 commenti 4 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

type/enhancement
Lingua principale
Java
Stelle
8.7k
Fork
1.9k
Merge medio
2g 17h
PR unite (30g)
9

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dal modulo Core e verifica come vengono dichiarati gli artefatti shaded e impacchettati nel jar di testcontainers. Esamina quali dipendenze elencate sono necessarie, misura le dimensioni del jar impacchettato e decompresso e confronta gli approcci di shading e BOM. Il lavoro è completato quando è stata definita una strategia per le dipendenze che riduca il jar Core senza rompere i suoi consumer.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
build-system
Tipo di issue
Refactoring
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.