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

Run *.exe file from inside JAR

I have a huge JAR file, which I created with Maven Shade plugin. I run this with java -jar foo.jar , and my UI opens. Now I want to execute *.exe file, which is also in that JAR file, how can I do this? I tried putting the exe to my classpath and…
Jaanus
  • 16,161
  • 49
  • 147
  • 202
2
votes
2 answers

Packaging camel project with cxf jars

I just started looking into Camel, and started off with some out of the box examples. It works great when using mvn camel:run. I am also trying to package this as one uber jar and be able to execute it from the command line. I am using the Maven…
2
votes
6 answers

Configure maven-shade-plugin to include src/main/webapp

I'm working with a simple project, with the webapp directory in the standard location (src/main/webapp). For some reason, it looks like the maven-shade-plugin doesn't include that in the final generated jar - it will only include artifacts…
Eugen
  • 8,523
  • 8
  • 52
  • 74
1
vote
0 answers

FileNotFoundException after packing in executable jar

After using maven shade plugin and running the executable jar, my application failed due to FileNotFoundException. During the application development I put my files in src/main/resources and so my path was defined like this…
ilija
  • 543
  • 1
  • 11
  • 19
1
vote
3 answers

Maven Shade Plugin + Launch4j

I have two maven projects inside the same folder. One is dependent upon other i.e. has the other one it its dependencies. Now I would like to use maven shade plugin and launch4j but it seems to complicated to me. Can somebody give me a step by step…
ilija
  • 543
  • 1
  • 11
  • 19
1
vote
0 answers

Maven Shade Plugin transformer to merge text files, discarding duplicate lines

Is there a resource transformer available for the Apache Maven Shade Plugin that will merge text files of the same name as does the AppendingTransformer, but throw out duplicate lines (i.e. perform a union of the lines in all files with the…
1
vote
1 answer

JavaFX build with shade, LoadException?

After following this SO post (JavaFX build with shade, Location is required. Where is it looking?), I have configured my project to be the same. But when running: java -jar .\target\app-name-1.0.0-ALPHA.jar I get the following exception: Exception…
Conor Egan
  • 518
  • 1
  • 3
  • 21
1
vote
0 answers

Maven Shade Plugin - add version of dependency jar in MANIFEST

I'm using the shade plugin to deploy a 'fat' jar of our application. One of the dependencies in our application utilizes ClassName.class.getPackage().getImplementationVersion(); Which, from my understanding and experience thus far, takes the…
Kevin
  • 11
  • 1
1
vote
1 answer

Error creating shaded jar: Error in ASM processing class kotlin/collections/ArraysKt___ArraysKt.class: UTF8 string too large

I am trying to upgrade kotlin version of shading project but i am getting below issue when i upgrade to kotlin 1.5.30: org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal…
1
vote
1 answer

Geotools: Getting IllegalArgumentException: Argument "ellipsoid" should not be null after "org.opengis.referncing.NoSuchAuthorityCodeException" error

I encountered the common "org.opengis.referencing.NoSuchAuthorityCodeException: No code "EPSG:4326" from authority "EPSG" found for object of type "EngineeringCRS" while trying to run my packaged jar on an Apache Flink cluster. I already had…
1
vote
0 answers

Spring boot 2.7.3 and custom CharsetProvider

I'm trying to register a custom CharsetProvider. As suggested in the https://stackoverflow.com/questions/39641604/spring-boot-1-4-x-and-custom-charsetprovider post we upgraded our application to use maven shade plugin for packaging which was…
1
vote
0 answers

How to use Kotlin in a library without forcing consumers to take Kotlin Stdlib as a dependency?

I am working on a Java-based library, and I'd like to start using Kotlin. However, there are over 10k known direct consumers, and I don't want to introduce a new dependency to all of the consumers. For consumers that are already using Kotlin, I…
Matthew Pope
  • 7,212
  • 1
  • 28
  • 49
1
vote
1 answer

Spring Boot is not compatible with this Spring Cloud release train

I am trying to create shaded jar for my spring project with bellow pom.xml, which runs fine in IDE but when I run mvn clean package and execute the jar with java -jar .\flink-0.0.1-SNAPSHOT-test.jar I am getting: Your project setup is incompatible…
ihristov
  • 97
  • 1
  • 8
1
vote
0 answers

How do you add contents of two jars to uber jar with Maven shade plugin?

I have two projects. Project A has only resources. Project B has resources and class files. Project B has 3rd party dependencies. I have installed the jar for the project B to local repository (mvn install). If I use Maven Shade plugin in project…
mikkmar
  • 21
  • 4
1
vote
1 answer

Mavn shade plugin with AWS Lambda

I’m using the maven shade plugin as below to create a jar for aws lambda org.apache.maven.plugins maven-shade-plugin