maven-shade-plugin icon indicating copy to clipboard operation
maven-shade-plugin copied to clipboard

[MSHADE-141] keepDependenciesWithProvidedScope does not work

Open jira-importer opened this issue 12 years ago • 9 comments

Steve Tynor opened MSHADE-141 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:

1 votes, 7 watchers

jira-importer avatar Mar 26 '13 11:03 jira-importer

Steve Tynor commented

test cases

jira-importer avatar Mar 26 '13 11:03 jira-importer

Olivier Lamy commented

keepDependenciesWithProvidedScope concern only the generated dependency-reduced-pom.xml

jira-importer avatar Apr 28 '14 21:04 jira-importer

Olivier Lamy commented

BTW IMHO this slf4j api should be runtime?

jira-importer avatar Apr 28 '14 21:04 jira-importer

Karl Heinz Marbaise commented

Is this true for shade plugin version 2.3 ?

jira-importer avatar May 29 '15 23:05 jira-importer

Shivam Singh commented

Is it possible to include dependencies with provided scope in final jar creation via shade plugin ?

Do I need to use "createDependencyReducedPom" in order to use "keepDependenciesWithProvidedScope" config.

 

jira-importer avatar Nov 30 '18 13:11 jira-importer

Delany commented

Could do with a shadeDependenciesWithProvidedScope option

jira-importer avatar Oct 22 '21 07:10 jira-importer

Robert Scholte commented

provided means it is already available on the targeted runtime environment, so it doesn't make sense to include that in the shaded jar. You better find the proper scope for your dependency.

jira-importer avatar Oct 22 '21 07:10 jira-importer

Delany commented

You're right. Thing im using does not support dependency-reduced/flattened pom

jira-importer avatar Oct 22 '21 08:10 jira-importer

Delany commented

Still an issue with plugin version 3.4.0 in the dependency-reduced-pom.xml

jira-importer avatar Sep 15 '22 11:09 jira-importer