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

Maven shade plugin - don't relocate excluded/optional scope dependencies

I'm using maven shade plugin in order to create an uber jar while relocating all classes. That's because I'm getting an external jar and I don't want to have classpath collisions. So the idea is to create a new uber (relocated) jar and use it in my…
yishaiz
  • 2,433
  • 4
  • 28
  • 49
2
votes
1 answer

Maven shade plugin - Jar and dependencies

I'm using shade plugin to shade org.apache.poi jar because there is an old version on Tomcat server. I have a problem because this jar makes reference to others jars (commons-compress, xmlbeans, commons-collections). How can I shade not only this…
Aldo Inácio da Silva
  • 824
  • 2
  • 14
  • 38
2
votes
0 answers

Maven Shade Plugin: overlapping resource warnings still thrown after adding ApacheLicenseResourceTransformer

I am creating an uber jar using the maven-shade-plugin. When running package, it throws the following warning: connect-api-1.1.0.jar, kafka-clients-1.1.0.jar define 2 overlapping resources: - LICENSE - NOTICE In response, I add the…
LukeG
  • 117
  • 8
2
votes
2 answers

How to get a list of the jar included in the uberjar build by maven shade plugin?

I have a (long) list of what should not be included in my uber-jar, and I would like the list of what is included, so that I can work on the configuration and remove duplicates. I looked at the output printed by mvn package that lists a lot…
Juh_
  • 14,628
  • 8
  • 59
  • 92
2
votes
1 answer

When building an application jar with Maven Shade, is it safe to exclude all META-INF/versions directories/files?

I believe the versions folders are there to support multiple Java versions. We always build for a very specific version (at this time 11). Is there a danger to excluding those directories/files when creating our single application…
HeavyE
  • 2,132
  • 1
  • 23
  • 31
2
votes
2 answers

Unable to run a Spark Scala JAR on GCP Dataproc

I have created a simple Spark application in Scala which is running fine locally. I have used Maven as a build tool and am packaging the JAR file using shade plugin. The directory structure looks like this: I am using the following pom.xml…
2
votes
2 answers

Install über jar with maven-shaded-plugin

I have been using maven assembly plugin to create uber jar and deploy to Artifactory. I switched to maven shade plugin to shade some dependencies. Now my jar is not deployed during install phase. In the maven assembly plugin documentation: When the…
Luk
  • 2,186
  • 2
  • 11
  • 32
2
votes
1 answer

How to avoid maven shade plugin from including transitive dependencies from 'test-jar' types?

I am working on a multi-module Maven project which has intermodule dependencies. For example: One of the project's module, say spark-module has a dependency on another module (say core-module) from the same project. The core-module has a dependency…
Sivaprasanna Sethuraman
  • 4,014
  • 5
  • 31
  • 60
2
votes
1 answer

Cannot find 'manifestEntries' in class org.apache.maven.plugins.shade.resource.ServicesResourceTransformer

I am trying to create a FAT jar and combine entries in META-INF/services/io.vertx.config.spi.ConfigProcessor from vertx-config and vert-config-yaml JAR files. I do not see a need for mainfest entry options for ServicesResourceTransformer, but I am…
2
votes
0 answers

Why does relocation with the maven shade plugin has a error?

I am having some trouble running a job that includes a newer version of netty . This is a known problem. I try to solve it by shading the libraries using the Maven shade plugin. Therefore, I added the following lines to my pom.xml
xuanyu66
  • 21
  • 1
2
votes
1 answer

maven-shade-plugin : how add all dependencies and custom local jar to executable jar?

Maven 3 Java 1.8 In my pom.xml com.myproject/groupId> mixed-pojo 1.0-SNAPSHOT system
Alexei
  • 14,350
  • 37
  • 121
  • 240
2
votes
1 answer

Akka missing Config Properties Akka.Version Akka.Stream

Packaging Akka application. Hi I am trying to package my application into an executable Jar. Below is my Pom.xml
iam.Carrot
  • 4,976
  • 2
  • 24
  • 71
2
votes
1 answer

Maven Surefire Double-Counting Tests

While not terribly well-versed in Maven lifecycles, I have read a fair amount of documentation over the last ~three days and found nothing showing a relationship between build cycles, goals, or my plugins and the issue I'm seeing. I'm experiencing a…
2
votes
1 answer

Mixing maven Shade with Proguard

I am trying to make a complex build with Maven Shade and Proguard. The thing is that I only want to obfuscate my code and some related libraries (declared in the pom as dependencies), more libraries are present in the pom.xml but I do not want to…
Eingel
  • 141
  • 13
2
votes
1 answer

Maven: Shade version used in third-party dependency instead

Say my project is called A, and Foo and Bar are third party libraries. A depends on Foo version 1 and Bar. Bar depends on Foo version 2: A -> Foo version 1 \-> Bar \-> Foo version 2 With this Maven shade plugin config in my project's,…
flow2k
  • 3,999
  • 40
  • 55