testcontainers / testcontainers/testcontainers-java
[Enhancement]: Shrink size of core-jar / Rethink shading
まだ誰も着手していません。
- 主要言語
- Java
- スター
- 8.7k
- フォーク
- 1.9k
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 9
説明
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.bouncycastleororg.awaitability.
There are also other libraries that could be easily replaced, e.g.guavaas 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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Coreモジュールから始め、shaded artifactがどのように宣言され、testcontainers jarにパッケージ化されているかを調査します。列挙されている依存関係のうち必要なものを確認し、パッケージ化済みと展開済みのjarのサイズを測定して、shadingアプローチとBOMアプローチを比較します。完了とは、コンシューマーを壊すことなくCore jarを小さくする、決定済みの依存関係戦略が得られていることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- build-system
- issue の種類
- リファクタリング
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100