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

How to use "PropertiesMergingResourceTransformer" of maven-shade-plugin when adding SpringBoot configuration as tag

I am using maven-shade-plugin along with Sprint Boot. I have defined spring-boot dependencies as: org.springframework.boot
Anshuli
  • 21
  • 1
  • 4
2
votes
1 answer

Running maven-shade and dockerfile-maven in different phases

My app uses maven-shade-plugin to pack things into single fatjar and then I would like to build a docker image using dockerfile-maven-plugin, my problem is that I can set the pom file properly so it would work. What happens is that the docker plugin…
Shvalb
  • 1,835
  • 2
  • 30
  • 60
2
votes
1 answer

NO shaded jar found in target after maven shade plugin packages the project

On running mvn package:shade shade, the log has entry which says:Replacing XYZ.jar with XYZ-shaded.jar but in my target directory, I cannot find shaded jar This is my pom regarding maven shade After trying , this pom helped me
Roma Jain
  • 333
  • 4
  • 13
2
votes
2 answers

Getting my dependencies into my JAR

I can package a JAVA project I've written. One which uses the Gson library for JSON features. I'm very new to JAVA so I could be making a dumb mistake but here's what I've assumed: In the source code I have: import com.google.gson.Gson; and then…
ken
  • 8,763
  • 11
  • 72
  • 133
2
votes
1 answer

Exclude all but some artifacts with Maven shade

Is there a way to create a fat jar with Maven that only contains some but not all dependency artifacts? More concretely, I want to have two executions of shade: one that includes com.acme:* and one that includes all else. The point is to have two…
ktdrv
  • 3,602
  • 3
  • 30
  • 45
2
votes
1 answer

maven shade plugin doesn't let me consume the reduced-dependencies.pom

After creating a jar with shade plugin, where I shaded a certain dependency, the reduced-dependencies.pom is generated and I would like to consume it in a different project. I can't understand how this can be done, as ONLY the complete original pom…
aviad cohen
  • 637
  • 1
  • 6
  • 16
2
votes
0 answers

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

when my use maven-shade-plugin package a execute jar, then Failed, and print error message:Cannot find 'resource' in class org.apache.maven.plugins.shade.resource.ManifestResourceTransformer follow is my config:
Jack huang
  • 21
  • 2
2
votes
1 answer

does maven shade plugin transformers accepts wildcards

Recently I found a solution to a problem with an application I'm working on. Briefly: I was building my application with maven shade plugin and I was having a problem because JasperReport was giving me a JRRuntimeException. I solved it by adding a…
Alvaro Pedraza
  • 1,176
  • 6
  • 20
  • 44
2
votes
1 answer

Maven Shade Plugin - Excluding some a class of mine from being modified by the relocation process

I'm using Maven Shade Plugin to relocate some classes of Apache. The issue which I'm facing is that I have this string as part of my classes: private static final String ORG_APACHE_HTTP_HTTP_REQUEST = "org.apache.http.HttpRequest" However the Maven…
nadavy
  • 1,755
  • 1
  • 18
  • 33
2
votes
1 answer

AWS CodeBuild failed to create Fat jar

I have created AWS Lambda function and now I am trying to setup deployment on AWS. I have created buildspec.yml file with following content: version: 0.1 phases: build: commands: - echo Entering build phase... - echo Build started…
2
votes
1 answer

Configuration inheritance regarding the Maven Shade Plugin

Currently I have problems with the configuration inheritance of the Maven Shade Plugin, what I mean by this is that artifactSet and all configuration options "underneath" it turn red whenever I remove the phase and goals options (which are meant to…
Julian
  • 837
  • 1
  • 11
  • 24
2
votes
2 answers

Maven shade plugin relocate and bundle not working

In my POM.xml, I have used maven-shade plugin and relocated the httpClient dependency. But when I print the dependency tree using mvn dependency:tree, I still see the httpClient library in the tree as shown below. Why is this happening. Any help…
thevillageguy
  • 123
  • 2
  • 9
2
votes
0 answers

ScalaPB and shading with SBT isn't working

I'm trying to get https://scalapb.github.io/">ScalaPB to work with Spark. In order to do this I need to shade my protocol buffers within SBT using code like below assemblyShadeRules in assembly := Seq( ShadeRule.rename("com.google.protobuf.**" ->…
Jon
  • 3,985
  • 7
  • 48
  • 80
2
votes
1 answer

Shading multiple versions of same dependencies required for functioning application

I've got a multi-project application where we use a library, oshi, that depends on version 4.2.2 of JNA. In our project itself, we use 4.3.0, which hasn't been released yet. We made a contribution that will be in 4.3.0 when it ever gets released,…
Kevin Milner
  • 821
  • 2
  • 14
  • 30
2
votes
1 answer

Kryo library has "overlapping classes" warning in maven shade-package phase

I am trying to create a shaded jar file but the shade plugin is giving me warnings. I am not sure how to fix them. Here is my pom.xml
user2250246
  • 3,807
  • 5
  • 43
  • 71