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

Disable additional jars for the maven-shade-plugin

I am using the maven-shade-plugin to create a single executable jar. I would expect the plugin to create a single jar (foo.jar) in the target directory. However it will also create two other jars: original-foo.jar and foo-shaded.jar. Why does it…
michas
  • 25,361
  • 15
  • 76
  • 121
10
votes
2 answers

Maven Shade plugin: how resolve the warning message "define 1 overlapping resource: [WARNING] - META-INF/MANIFEST.MF"

For ... com.manuel.jordan some module 0.0.1-SNAPSHOT ...
Manuel Jordan
  • 15,253
  • 21
  • 95
  • 158
10
votes
4 answers

Maven shade plugin failed to execute goal?

There error message in question is [ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.1.0:shade (default) on project myapp-core: Error creating shaded jar: null: IllegalArgumentException -> [Help 1] from mvn package in…
jMan
  • 587
  • 1
  • 8
  • 23
10
votes
1 answer

maven shaded jar: change output location

I'm having difficulty using the Maven Shade Plugin because I would like to have my shaded jar be installed to the same folder as the Parent pom (instead of the local src/target directory). The layout: maven_project guide/ parent_pom.xml projA/ …
Max
  • 2,072
  • 5
  • 26
  • 42
10
votes
2 answers

Exclude META-INF/maven folder from the generated jar file

I am trying to create a jar file which has all the necessary classes extracted within the jar. But for few dependent jar like log4j, it creates some folders inside META-INF/maven/*. I have a limitation that the server in which I will be placing the…
coderslay
  • 13,960
  • 31
  • 73
  • 121
10
votes
3 answers

no main manifest attribute, in jar

I am trying to run a jar created by the maven shade plugin. I am configuring the main class the following way: ... org.apache.maven.plugins
user_mda
  • 18,148
  • 27
  • 82
  • 145
9
votes
4 answers

Use maven-flatten-plugin and maven-shade-plugin at the same time

How to use the maven-flatten-plugin and maven-shade-plugin at the same time? I use revision,sha1,changelist to manage the versions of a multi-module project. In order to deploy cosumable artifacts, I use maven-flatten-plugin to generate a flattened…
宇宙人
  • 1,197
  • 3
  • 10
  • 28
9
votes
1 answer

Shading a dependency in Maven

I have two dependencies imported via Maven that both import a common library, but at different versions but the versions are not compatible with each other. Essentially the problem described in this post: But unfortunately for me, the solution is…
kevmo314
  • 4,223
  • 4
  • 32
  • 43
9
votes
1 answer

Making the module jdk.incubator.httpclient visible at runtime

Question How can I make the classes from the module jdk.incubator.httpclient visible at runtime? What I'm Using Java 9 + Maven + HttpClient jdk.incubator.http.HttpClient Problems => Maven build failing when using jdk.incubator.HttpClient. Fixed with…
Caleb Bassham
  • 1,874
  • 2
  • 16
  • 33
9
votes
0 answers

Exclude all transitive dependencies with Apache Maven Shade Plugin

I have used Apache Maven Shade Plugin to create fat jar (the jar which includes all classes from all dependencies). My current project folder structure looks something like this, > Parent Module (packaging pom) > Module 1 (packaging jar) …
9
votes
1 answer

How can I specify a custom MANIFEST.MF file while using the Maven Shade plugin?

When a project uses the Maven-jar-plugin, it's easy to include a custom manifest file in the jar, but I can't find a way to do the same thing with Maven shade. How can I use my own manifest file while using the "Maven-shade-plugin"? Additional…
BlakeTNC
  • 941
  • 11
  • 14
9
votes
2 answers

maven-shade-plugin reports: Error creating shaded jar: ...target/classes (Is a directory)

When running a Maven build in eclipse using the m2eclipse tooling for a project that is configured for the Maven Shade Plugin, the build fails with the following error message: Failed to execute goal…
mxro
  • 6,588
  • 4
  • 35
  • 38
9
votes
2 answers

m2e shade eclipse "project main artifact does not exist"

I'm trying to make a deployment package that bundles all the dependencies of my maven module that has dependencies to another maven project in eclipse. I have this in my…
romerun
  • 2,161
  • 3
  • 18
  • 25
8
votes
2 answers

Does maven-shade-plugin work with scala classes?

I have a maven project with both Java and Scala components, but when I use maven-shade-plugin, it relocates package names for both Java and Scala files, but ONLY renames packages inside Java files, Scala files still contain the older package names,…
Jas Bali
  • 241
  • 2
  • 10
8
votes
1 answer

Spring 3 NamespaceHandler issues with Maven Shade plugin

Spring 3.1.1.RELEASE with Apache Maven 3.0.3 and Maven Shade plugin 1.6. Using the mvn shade plugin to package the artifact in an uber-jar, including its dependencies: org.apache.maven.plugins
Andrew Eells
  • 735
  • 12
  • 30