apache / apache/maven-shade-plugin

[MSHADE-411] When Shade finds overlapping classes, clarify which class is added to final artifact

Open
#656 3 comments 0 reactions 0 assignees View on GitHub
enhancement priority:minor
Dominant language
Java
Stars
188
Forks
103
Avg merge
16h 39m
Merged PRs (30d)
4

Description

**[John Hendrikx](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=john16384)** opened **[MSHADE-411](https://issues.apache.org/jira/browse/MSHADE-411?redirect=false)** and commented

For example:

[WARNING] mediasystem-jfx-2.0.0-SNAPSHOT.jar, javafx-controls-16-win.jar define 5 overlapping classes:

[WARNING] - javafx.scene.control.skin.SpinnerSkin$2

[WARNING] - javafx.scene.control.skin.SpinnerSkin

[WARNING] - javafx.scene.control.skin.SpinnerSkin$1

[WARNING] - javafx.scene.control.skin.SpinnerSkin$4

[WARNING] - javafx.scene.control.skin.SpinnerSkin$3

Here I purposely override the SpinnerSkin class to fix a bug. But it is unclear which version eventually will make it in the uber.jar (I'm hoping it takes it from the first jar listed).

I could not find anything on the website, faq, stackoverflow that clarifies **which** version of the class gets included.

---
No further details from [MSHADE-411](https://issues.apache.org/jira/browse/MSHADE-411?redirect=false)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the code path that emits the overlapping-classes warning for the shaded uber-JAR, and trace how duplicate classes are selected. Check the existing Maven Shade Plugin documentation and tests for any stated ordering behavior. Done should make the selected class unambiguous to users and document the relevant behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.