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
4
votes
2 answers

Maven shade-plugin relocation not updating a entry in resource file

I am trying shade aws-java-sdk in order to resolve library conflicts as per the recommendation mentioned here. But I see that maven-shade-plugin, the entries in resource files (text) are not getting updated. For example contents of the…
4
votes
1 answer

Exclude Classes from Being Included in Shaded Jar

I'm trying to exclude certain classes from being included in a shaded jar. I have tried several different configurations but for some reason the jars are still being included in my jar. Here is the plugin setup:
cscan
  • 3,684
  • 9
  • 45
  • 83
4
votes
1 answer

Can the Maven shade plugin fail the build when there are duplicate classes?

The Maven shade plugin coalesces your project's Java classes along with its dependencies into a single über JAR file. If there is any overlap (e.g. two dependencies contain a class with the same qualified name), it issues a warning and (if I…
4
votes
3 answers

Create dependency folder with Dependent jars with Maven Shade plugin

I am creating a fat jar using maven shade plugin, which includes some bouncy castle jars too. But this creates the problem because of the unsigned version of Bouncy Castle. java.lang.SecurityException: JCE cannot authenticate the provider BC Now one…
Pulkit Anchalia
  • 766
  • 7
  • 8
4
votes
1 answer

Maven: compile a project using shade-plugin specifying main class and properties file

New to Maven, I was trying to compile a project using Maven with maven-shade-plugin (as it seems the best plugin to build a fat jar out there). I tried to specify my main class to make a runnable jar file and some .properties files which contains…
A7X
  • 119
  • 2
  • 12
4
votes
2 answers

Excluding dependency in maven

I have a problem with conflicting dependencies in my project. Particularly, there are two implementations of slf4j logging: slf4j-simple and logback-classic, and I'm getting SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in…
Alexander
  • 753
  • 2
  • 10
  • 25
4
votes
1 answer

Maven Shade Plugin with minimizeJar

I'm building a uber jarfile but slimmed with the true option to the maven shade plugin. I get this error with that option set: $> java -jar target/lambda-send-email-1.0-SNAPSHOT.jar Exception in thread "main"…
Wrench
  • 4,070
  • 4
  • 34
  • 46
4
votes
1 answer

An API incompatibility was encountered while executing org.apache.maven.plugins:maven-shade-plugin:1.3.1:shade: java.lang.AbstractMethodError: null

While trying to build an old version of Apache CXF 2.2.2, I kept getting an error produced by an XmlAppendingTransformer used by the maven-shade-plugin: unable to connect to get the DTD for http://java.sun.com/dtd/properties.dtd (referenced by the…
Sorin Postelnicu
  • 1,271
  • 1
  • 10
  • 15
4
votes
2 answers

Maven shade plugin ClassNotFoundException

I'm trying to use the maven shade plugin. I'm using: Java 7, Spring 4.1.6.RELEASE, Hibernate 4.3.9Final, maven-shade plugin version 2.3 I have the following error. Can't figure out the problem. BeanCreationException: Error creating bean with…
Valentina
  • 41
  • 4
4
votes
0 answers

Maven Shade Plugin How does it resolve multiple versions of same dependency?

I am using shade plugin to create the uber jar. My pom refers to two dependencies which in turn have transitive dependencies of the same jar but with different versions. One refers to jsoup-1.7.3 and another refers to an older version. Will the…
alpana
  • 41
  • 4
4
votes
3 answers

Transitive dependencies of a shaded JAR

I have packaged myjar using maven-shade plugin and am interested to know how it will behave when referenced by a client maven project Does a maven shaded jar download transitive dependencies when referenced in a maven environment? Am I able to…
Andrew Gray
  • 3,593
  • 3
  • 35
  • 62
4
votes
5 answers

How to skip the maven antrun copy/shade:shade goal dynamically?

I am using maven for configuration of an application consisting of multiple small services. Most of the services developed in java share the same maven configuration, as in the same build lifecycle, some shared resources (like spring AMQP). So I…
4
votes
2 answers

maven-shade-plugin vs maven-assembly-plugin

I wrote a hadoop MR job using spring-data-hadoop and used maven-shade-plugin to pack all necessary jars. But when I ran the job from comand line:hadoop jar , it gave me Exception for ClassNotFound for the spring-beans. Resulting problem in loading…
4
votes
0 answers

Cant load resources in Maven shade uber jar

I need to be able to create an executable jar for my project where everything is packaged in the one jar. I think that the Maven shade build plugin is the best way to do this however I'm experiencing some problems loading my resources when running…
Sarah Tattersall
  • 1,275
  • 2
  • 21
  • 32
4
votes
1 answer

m2eclipse : Maven dependencies as JAR's not projects

I'm having maven project on Eclipse with m2eclipse plugin. This project has some dependencies. Some of them are libraries as slf4j, apache-commons etc. But there are also mine libraries, that I'm developing simultaneously in eclipse. Unfortunately…
Arek
  • 3,106
  • 3
  • 23
  • 32