Questions tagged [maven-shade-plugin]

This plugin provides the capability to package the artifact in an uber-jar, including its dependencies and to shade - i.e. rename or remove - the packages of some of the dependencies.

Sources : http://maven.apache.org/plugins/maven-shade-plugin/index.html

Goals Overview

The Shade Plugin has a single goal:

shade:shade is bound to the package phase and is used to create a shaded jar.

Usage

General instructions on how to use the Shade Plugin can be found on the usage page. Some more specific use cases are described in the examples given below. Last but not least, users occasionally contribute additional examples, tips or errata to the plugin's wiki page.

In case you still have questions regarding the plugin's usage, please feel free to contact the user mailing list. The posts to the mailing list are archived and could already contain the answer to your question as part of an older thread. Hence, it is also worth browsing/searching the mail archive.

If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our issue tracker. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from our source repository and will find supplementary information in the guide to helping with Maven.

Official site : http://maven.apache.org/plugins/maven-shade-plugin/

Maven Repository site : https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-shade-plugin

529 questions
3
votes
1 answer

maven zip uber-jar and shell script

I would like maven to combine an uber-jar created by the shade-plugin and a shell script from the all_files directory. The project structure looks like this: all_files/ mvn_script.sh projB-shaded.jar maven_project/ guide/ …
Max
  • 2,072
  • 5
  • 26
  • 42
3
votes
1 answer

Relocating fastxml.jackson classes to my.package.fastxml.jackson

I'm trying to relocate the packages from "com.fasterxml.jackson" into my own package (ie, "mypackage.com.fasterxml.jackson") and then consume it in another JAR which I own. I've managed to run the maven-shade plugin to do it using this…
nadavy
  • 1,755
  • 1
  • 18
  • 33
3
votes
1 answer

Using Maven's shade plugin for third party libraries?

TL;DR version Can Maven's shade plugin affect third party libraries? Longer version My co-worker and I have been arguing about using Maven's shade plugin to fix dependency errors on third party libraries. We have the following dependency…
3
votes
2 answers

Axiom Implementation Loader Override

I have been running into a string of issues with Axiom and Mule, a background can be found here: https://stackoverflow.com/questions/34164577/classloader-overrides-not-working-in-mule As mentioned in the comment of the previous issue, I was able to…
MonomiDev
  • 301
  • 2
  • 8
3
votes
1 answer

Rename files inside a jar using some maven plugin

I have a jar build by maven-shade-plugin. It contains META-INF/services with several files. These files have wrong names (because of the bug https://issues.apache.org/jira/browse/MSHADE-182). I'd like to rename these files. What is the easiest way…
long
  • 414
  • 4
  • 15
3
votes
1 answer

Manifest in maven-shade-plugin is not working

Goal: Create build number and put it in the manifest generated by maven-shade-plugin. Then, read that build number. I have used ManifestResourceTransformer and declared manifestEntries there.
Fadils
  • 1,508
  • 16
  • 21
3
votes
2 answers

Maven shade executable uber jar NoClassDefFoundError

I am creating a executable uber jar with the maven shade plugin, it has a dependency on some classes in a local system jar (mobile-dock-support.jar) that I want it to include during the package phase, so I have the shade plugin configured like…
PDStat
  • 5,513
  • 10
  • 51
  • 86
3
votes
0 answers

exclude a path with maven-shade-plugin

I am kind a new with the maven-shade-plugin so sorry for the basic question. I want to exclude a path with maven-shade-plugin to a directory that is under my src/main/resources. meaning instead of all the xml in the example i want to path to…
Matoy
  • 1,738
  • 3
  • 22
  • 53
3
votes
1 answer

Invalid signature file digest for Manifest main attributes w/ Jetty and Maven Shade Plugin

I've seen a few other SO Q&As on this topic, but so far none of the solutions have worked for me: "Invalid signature file" when attempting to run a .jar Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for…
Sean Barbeau
  • 11,496
  • 8
  • 58
  • 111
3
votes
1 answer

maven-shade-plugin and custom packaging type

I'm trying to package an OSGi bundle with it's dependencies builtin. I'm using maven-shade-plugin 2.3 for including some dependencies, but it fails during packaging stage with the following error: [ERROR] The project main artifact does not exist.…
Artem Zhirkov
  • 157
  • 12
3
votes
0 answers

Java/Maven: how to remove content from shaded JAR at compile time?

I am in my project reusing an open source maven-based component that includes a bunch of shaded (e.g, using the maven-shade plugin) direct and transitive dependencies in the component uber-jar. Unfortunately some of those dependencies clash with…
Karl
  • 75
  • 1
  • 6
3
votes
1 answer

Maven Shade Plugin not attaching shaded artifact

I'm trying to use the maven-shade-plugin to distinguish between Java 6 and Java 7 artifacts. My understanding from this link is that the original artifact will be replaced by the shaded one [INFO] Replacing original artifact with shaded…
Carlos Bribiescas
  • 4,197
  • 9
  • 35
  • 66
3
votes
1 answer

What is the difference between the jars produced by Maven's Shade plugin?

In my Maven project, I have tried the maven-shade-plugin to produce an uber jar when I run mvn package. As a result, I get three jars in my target…
anishpatel
  • 1,472
  • 1
  • 16
  • 23
3
votes
2 answers

What is `dependency-reduced-pom.xml` file which created when calling maven package command?

I'm following maven tutorial from springsource here, and after 1) adding joda-time dependency , and 2) calling mvn package commmand, we get the below file dependency-reduced-pom.xml. My question is, what is the purpose of creating this file besides…
Nam G VU
  • 33,193
  • 69
  • 233
  • 372