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

Including a non-Mavenized dependency so it works with maven-shade-plugin

I want to include GData Client, which doesn't use Maven, as a dependency into my Maven project. It ships as a bunch of JAR files. Additionaly, I use Maven Shade Plugin to build an executable JAR without any external dependencies (with the default…
Jaka Jančar
  • 11,386
  • 9
  • 53
  • 74
7
votes
2 answers

maven-shade-plugin doesn't replace the original jar

It is weird that my maven-shade-plugin doesn't replace the original jar with the shaded jar. Does anyone know what could be the reason? Here's my plugin in pom.xml org.apache.maven.plugins
zjffdu
  • 25,496
  • 45
  • 109
  • 159
7
votes
3 answers

Apache Spark -- using spark-submit throws a NoSuchMethodError

To submit a Spark application to a cluster, their documentation notes: To do this, create an assembly jar (or “uber” jar) containing your code and its dependencies. Both sbt and Maven have assembly plugins. When creating assembly jars, list Spark…
user4728253
7
votes
1 answer

How to use maven shade to build jar and war

I'm on a project working with openrdf, and I require the shade plugin to transform my service entries. I would like to build a war and a jar simultaneously, as both usages are possible. However, I cannot get the shade plugin to produce a shaded jar…
Keno
  • 307
  • 3
  • 11
7
votes
1 answer

Can we add maven plugin without attach its goal to a particular phase?

Hi I am new to Maven I am wondering how can I use a plugin without attach its goal to a particular phase. So for example I want to use shade plugin to create uber-jar(fat jar). Goals Overview The Shade Plugin has a single goal: shade:shade is…
Xelian
  • 16,680
  • 25
  • 99
  • 152
7
votes
1 answer

IntelliJ mvn package is behaving differently that command line

In my project when I go to the cmd line and type: mvn package It creates a single fat .jar file in my /target directory. I am using maven shade plugin. I want to be able to do this in IntelliJ, so in my run configurations for maven, I set the…
Blankman
  • 259,732
  • 324
  • 769
  • 1,199
6
votes
1 answer

Failsafe error: "Invalid signature file digest for Manifest main attributes" when using shade plugin

When using shade-plugin in maven and later trying to run integration tests using failsafe-plugin, I get the following error when failsafe is about to run, resulting in my integration tests being skipped: [ERROR] Invalid signature file digest for…
Ludwik
  • 2,247
  • 2
  • 27
  • 45
6
votes
0 answers

How do I include classes from log4j.xml when maven-shade-plugin minimizes the jar?

What I Have maven-shade-plugin configuration in my pom.xml: org.apache.maven.plugins maven-shade-plugin 3.2.1
NoBrainer
  • 5,853
  • 1
  • 27
  • 27
6
votes
0 answers

Is it possible to use maven shade plugin to relocate a library that uses native methods?

I'm trying to use maven-shade-plugin to relocate a library. Unfortunately, this library also includes some native implementation. The problem I'm facing is that after relocation to a different package, when trying to call the native methods from…
6
votes
3 answers

determine repository URL for maven deploy-file

I am using Maven to build a particular project, and within the POM I am building 3 different variants of the primary artifact using the maven shade plugin (I'm creating uber jars with various combinations of included logging frameworks). The shade…
Richard Sand
  • 642
  • 6
  • 20
6
votes
1 answer

How to stop maven-shade-plugin from blocking java.util.ServiceLoader initialization of opensaml-impl types

When using OpenSAML 3, you must first load components from the opensaml-saml-impl artifact with the following line of code: InitializationService.initialize(); This uses java.util.ServiceLoader to load any type which implements Initializer. When I…
Craig Stuntz
  • 125,891
  • 12
  • 252
  • 273
6
votes
1 answer

Maven Include Dependency in Shaded Jar Only

I'd like to use maven shade to create a shaded jar, but I'd also like to include a special dependency only in the case of the shaded jar (not in the normal compile dependencies of my project). How can I go about this? From my understanding the…
Hamel Kothari
  • 717
  • 4
  • 11
6
votes
1 answer

What should I do about dependency conflicts when using the maven-shade-plugin?

I'm using the maven-shade-plugin to create an executable jar that contains all of my project's dependencies. Sometimes, these dependencies bring in dependencies of their own that clash with the dependencies of other libraries, and the…
MusikPolice
  • 1,699
  • 4
  • 19
  • 38
6
votes
1 answer

How to deduplicate beanutils dependencies with commons-beanutils?

I have a project with several dependencies, which ultimately lead to depending on the following (I got these from sbt-dependency-graph plugin): commons-beanutils:commons-beanutils:1.7.0 commons-beanutils:commons-beanutils-core:1.8.0 As a…
ale64bit
  • 6,232
  • 3
  • 24
  • 44
6
votes
1 answer

maven shade plugin custom transformer

Given maven shade plugin resource transformers, how can we create custom ones? I've tried adding the shade plugin to my pom: org.apache.maven.plugins maven-shade-plugin
javamonkey79
  • 17,443
  • 36
  • 114
  • 172