apache / apache/maven-shade-plugin

[MSHADE-445] Be smarter about non .class files

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

Description

**[Elliotte Rusty Harold](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=elharo)** opened **[MSHADE-445](https://issues.apache.org/jira/browse/MSHADE-445?redirect=false)** and commented

Building maven surefire plugin shows these warnings:

{{[WARNING] commons-compress-1.21.jar, commons-io-2.11.0.jar, commons-lang3-3.12.0.jar define 2 overlapping resources:
[WARNING] - META-INF/LICENSE.txt
[WARNING] - META-INF/NOTICE.txt
[WARNING] maven-shared-utils-3.3.4.jar, surefire-shared-utils-3.1.2-SNAPSHOT.jar define 3 overlapping resources:
[WARNING] - META-INF/DEPENDENCIES
[WARNING] - META-INF/LICENSE
[WARNING] - META-INF/NOTICE
[WARNING] commons-compress-1.21.jar, commons-io-2.11.0.jar, commons-lang3-3.12.0.jar, maven-shared-utils-3.3.4.jar, surefire-shared-utils-3.1.2-SNAPSHOT.jar define 1 overlapping resource:
[WARNING] - META-INF/MANIFEST.MF
[WARNING] maven-shade-plugin has detected that some class files are
[WARNING] present in two or more JARs. When this happens, only one
[WARNING] single version of the class is copied to the uber jar.
[WARNING] Usually this is not harmful and you can skip these warnings,
[WARNING] otherwise try to manually exclude artifacts based on
[WARNING] mvn dependency:tree -Ddetail=true and the above output.
[WARNING] See https://maven.apache.org/plugins/maven-shade-plugin/}}

This got me to thinking:

1. For LICENSES and NOTICES the files are likely byte-per-byte identical. Don't warn in that case.
2. DEPENDENCIES and MANIFEST.MF should perhaps be rewritten and/or merged as common special cases, rather than simply copied as is.

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

Contributor guide

No contributing guide indexed for this repository

Research direction

No source files, tests, or entry points are named. Start by locating the duplicate-resource warning and handling for non-class files in the Maven Shade Plugin, then determine the expected behavior for identical LICENSE/NOTICE files and for DEPENDENCIES or MANIFEST.MF; done requires defined behavior and tests for these cases.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.