apache / apache/beam

Consider minimization on shaded jars

Open
#18,308 0 comments 0 reactions 0 assignees View on GitHub
build improvement P3
Dominant language
Java
Stars
8.7k
Forks
4.7k
Avg merge
1d 20h
Merged PRs (30d)
196

Description

Some of our modules shade and relocate Guava as part of their build, this adds a considerable amount to their file size, even though they do not use every single class in Guava's jar.
maven shade-plugin solves this by minimization which only shades classes which are in use in the module into the jar.

There are a few issues with configuring minimzation for our shaded modules currently:

1. There is a bug in shade-plugin where if minimization is declared on a project with pom packaging it fails. I have created a [ticket](https://issues.apache.org/jira/browse/MSHADE-253) and [PR](https://github.com/apache/maven-plugins/pull/107) with a fix for this but could take a while before it is available to us (The fix has been merged but not released yet).
2. Minimization on all of our modules adds a significant amount of build time, which we wish to avoid. (Up from 02:30 mins for a build of the entire project (skipping tests) on a Macbook pro laptop to over 5 mins)

Imported from Jira [BEAM-1720](https://issues.apache.org/jira/browse/BEAM-1720). Original Jira may contain additional context.
Reported by: aviemzur.

Contributor guide

Open the contributing guide

Research direction

No repository file or test is named. Start by reviewing the Maven configurations for the shaded modules and the Maven Shade Plugin minimization limitation, including MSHADE-253 and PR 107; done means reducing unused Guava content without an unacceptable build-time increase.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.