apache / apache/maven-shade-plugin

[MSHADE-141] keepDependenciesWithProvidedScope does not work

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

Description

**[Steve Tynor](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=tynor)** opened **[MSHADE-141](https://issues.apache.org/jira/browse/MSHADE-141?redirect=false)** and commented

keepDependenciesWithProvidedScope option does not seem to work.

Expected behavior from both poms is to create an uber jar from the following transitive dependencies:

[INFO] Including org.apache.activemq:activemq-client:jar:5.8.0 in the shaded jar.
[INFO] Including org.slf4j:slf4j-api:jar:1.6.6 in the shaded jar.
[INFO] Including org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1.1 in the shaded jar.
[INFO] Including org.fusesource.hawtbuf:hawtbuf:jar:1.9 in the shaded jar.
[INFO] Including org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:jar:1.0.1 in the shaded jar.

I've attached two test cases

mvn -f pom-direct.xml clean install

will create an empty jar.

mvn -f pom-indirect.xml clean install

will not include the slf4j-api which is a dependency of activemq-client, but is marked provided in the pom.

---

**Affects:** 2.0

**Attachments:**
- [pom-direct.xml](https://issues.apache.org/jira/secure/attachment/12718972/pom-direct.xml) (_1.08 kB_)
- [pom-indirect.xml](https://issues.apache.org/jira/secure/attachment/12718965/pom-indirect.xml) (_1.21 kB_)

1 votes, 7 watchers

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running `mvn -f pom-direct.xml clean install` and `mvn -f pom-indirect.xml clean install` against the attached reproductions. Compare the resulting jars with the expected transitive dependencies, especially slf4j-api, and trace how the keepDependenciesWithProvidedScope option handles direct and transitive provided dependencies. Done means both reproductions produce an uber jar containing the listed dependencies.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.