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

Netbeans: project's main artifact is processed through maven-shade-plugin

I am building my project with maven-shade-plugin and Netbeans 8.0 is complaining with the following warning: Project's main artifact is processed through maven-shade-plugin When the final artifact jar contains classes not originating in current…
Anastasios Andronidis
  • 6,310
  • 4
  • 30
  • 53
15
votes
4 answers

Using maven-bundle-plugin with the maven-shade-plugin

I'm using the maven-shade-plugin to relocate some packages during the package phase of my build. I'm also using the maven-bundle-plugin to generate a manifest. The problem is the bundle plugin runs before the shade plugin (during the process-classes…
Jonathan
  • 5,027
  • 39
  • 48
14
votes
1 answer

Maven - Is there a way to easily create an 'uber' jar with all the dependencies relocated?

We need to build a jar, using Maven, in a way that all its dependencies are included, but also that all those dependencies are renamed (relocated). Let's say our own packages all start with com.mycompagny.projectx.*". We want the project…
electrotype
  • 8,342
  • 11
  • 59
  • 96
13
votes
1 answer

Shaded/Repackaged jar as a dependency

We have a situation where we need one application to be able to connect to to two versions of kafka(0.7.2 and 0.10.0+) and act as a router. I'm trying to omit using two runtimes here as we need this to be stupid fast, so want to prevent additional…
Ján Srniček
  • 505
  • 1
  • 10
  • 34
13
votes
1 answer

Why does Maven shade plugin remove module-info.class?

I try to use maven-shade-plugin for a modular jar: org.apache.maven.plugins maven-shade-plugin 3.1.1
Mordechai
  • 15,437
  • 2
  • 41
  • 82
13
votes
3 answers

Using Maven shade plugin in a multi module project - NullPointerException

I have a scenario where-in I need to create an uber jar of a multi module maven project including all modules and their dependencies. I tried using maven shade plugin. but it seems to work only when I use it at the module level. If I add the plugin…
Manoj
  • 1,384
  • 4
  • 14
  • 19
13
votes
3 answers

maven-shade-plugin: exclude a dependency and all its transitive dependencies

Using maven-shade-plugin, is there a way to exclude a dependency (which is not provided) and all its transitive dependencies? For example : com.example
electrotype
  • 8,342
  • 11
  • 59
  • 96
13
votes
3 answers

How can I exclude *.DSA and *.SF files from shaded jar?

I have a section in pom.xml *:* META-INF/*.SF META-INF/*.DSA I want to…
Dzmitry Kashlach
  • 404
  • 1
  • 5
  • 16
12
votes
3 answers

Maven shade jar throw exception

I have the following Exception: Exception in thread "main" java.lang.SecurityException: no manifiest section for signature file entry javax/security/cert/CertificateException.class at…
lucky_start_izumi
  • 2,511
  • 13
  • 41
  • 61
12
votes
2 answers

Maven shade plugin remove "original"

Each time I run maven package to produce an updated jar, it creates an "original" jar file, as well as the updated one. This is particularly an issue for me due to the fact that I'm running the compiled jar automatically, and they're both trying to…
trev915
  • 391
  • 2
  • 11
12
votes
2 answers

Maven shaded jar used as external project dependency

I have used maven shade plugin in my project to relocate all dependency jar classes under one package e.g., org.shade.* When I try to use that shaded jar in other application as maven dependency it pulls dependency jar's. My expectation is when…
erdarun
  • 441
  • 1
  • 8
  • 14
11
votes
1 answer

How to use Scala XML with Apache Flink?

I am trying to use Scala XML library in Flink to parse an XML and I am not able to make it work. Please note that I need to use both the serialized and unserialized (string) version on my code in the same processing function. I tried already…
Jac
  • 531
  • 1
  • 4
  • 19
11
votes
3 answers

Apache spark Hive, executable JAR with maven shade

I'm building apache-spark application with Apache Spark Hive. So far everything was ok - I've been running tests and whole application in Intellij IDEA and all tests together using maven. Now I want to run whole application from bash and let it run…
11
votes
3 answers

Spring Boot With Maven Shade Plugin - Controllers not mapped (404 Error)

For my Spring boot application with embedded tomcat, due to some limitation I need to do away with spring-boot-maven-plugin and need to use maven-shade-plugin. With maven package command I could successfully create the jar file. However, all…
11
votes
2 answers

Shade (relocate) one version of a transitive dependency, but not the other

I've got a Maven project that contains two dependencies, A and B. Each of these depends transitively on C, but they depend on different versions of C. Let's say that A depends on C version 1, and B depends on C version 2. Unfortunately, A is not…
chiastic-security
  • 20,430
  • 4
  • 39
  • 67
1 2
3
35 36