Questions tagged [shadowjar]

About

Shadow is an extension of the Gradle Jar task that optimizes FatJar/UberJar creation by using JarInputStream and JarOutputStream to copy file contents. This avoids the unnecessary I/O overhead of expanding jar files to disk before recombining them. Shadow provides the similar filtering, relocation, and transformation capabilities as the Maven Shade plugin.

Links

101 questions
0
votes
1 answer

Gradle creating two Jar Files - i only want the "fat" one

I've that gradle.build file: import com.github.jengelman.gradle.plugins.shadow.tasks.ConfigureShadowRelocation import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { id 'java' id 'com.github.johnrengelman.shadow'…
Anonymous
  • 1
  • 1
0
votes
0 answers

Java version issue: gradlew build shadowJar: java.lang.IllegalArgumentException: Unsupported class file major version 63, (using compatible versions)

> ./gradlew --version ------------------------------------------------------------ Gradle 6.1.1 ------------------------------------------------------------ Kotlin: 1.3.61 Groovy: 2.5.8 Ant: Apache Ant(TM) version 1.10.7…
divide_by_zero
  • 997
  • 1
  • 8
  • 20
0
votes
0 answers

How to add ressource folder with json with the shadowjar plugin in gradle

Here is my problem, my build gradle with shadowjar works well execept that the src/main/ressources is not added to the jar. When i try to add include('src/main/ressources') it gives me a main class not found when launching the shadowjar…
Bussiere
  • 500
  • 13
  • 60
  • 119
0
votes
1 answer

Gradle Shadow plugin dependencies are not detected at runtime

I am building a mod jar. I need an external library to be included in the final jar (org.apache.httpcomponents:httpasyncclient:4.1.5). I am using the Shadow plugin to make the fat jar. However, I cannot get the dependencies to be included…
0
votes
0 answers

Is it possible to relocate all packages excluding the only one without specifying all

As I can see ConfigureShadowRelocation task does not support excludes. ShadowJar task does not support patterns in relocate method. I use version 7.1.2. Is there a way to do a bulk relocation with excludes? Maybe I missed something. UPD: Here is an…
0
votes
0 answers

How to create a publishable shaded jar from specific dependencies only and leave transitive the rest?

Our customer want us to provide them a lib from only the data layer of our multimodule spring boot project, that they can use in their whatever (probably spring) project. So they have to use our dependencies, but we do not really want to enforcing…
Daniel Hári
  • 7,254
  • 5
  • 39
  • 54
0
votes
0 answers

Implement a monorepo where A and B include common, but replace a class file in it

I am trying to make it so I can create a version of my java program where a paid flag is on in one build, and a free flag is on in the other using kotlin gradle. I have tried to do this so far by splitting most of my program into a common subrepo,…
Xemor
  • 1
  • 1
0
votes
0 answers

How to merge Log4j2Plugins.dat in android apk?

My Android application has duplicated log4j2plugins.dat in dependencies, which caused an error when building: 2 files found with path 'META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat'. Adding a packagingOptions block may…
Lenik
  • 13,946
  • 17
  • 75
  • 103
0
votes
0 answers

How to apply the Gradle Shadow plugin for conflicting dependencies in Android

I want to apply John Engelman's conflicting dependency shading plugin: https://imperceptiblethoughts.com/shadow/ to shadow 'com.google.api.grpc:proto-google-common-protos:2.9.2' from implementation…
user10263947
0
votes
1 answer

Ktor shadow plugin doesn't include my resources folder

I build my ktor project with this command: gradle shadowJar --no-daemon, but it doesn't add my resources folder to the fat jar. My build.gradle is this: val ktor_version = "2.0.2" val kotlin_version = "1.6.10" val logback_version = "1.2.11" plugins…
0
votes
1 answer

How to resolve "Could not get unknown property 'shadow' for project of type org.gradle.api.Project."

plugin used : id 'com.github.johnrengelman.shadow' version '4.0.4' Gradle : https://services.gradle.org/distributions/gradle-7.4.2-bin.zip getting error : A problem occurred evaluating root project 'iot-bulk-slice-worker'. > Could not get unknown…
0
votes
0 answers

.jar to .exe looses functionality

I have a javafx GUI application and created an executable .jar using shadowJar which works as intended when ran. The program uses Firebase to access the real-time database feature. however, once I wrap the .jar as an .exe using Launch4j, it seems…
Nick
  • 1
  • 1
0
votes
1 answer

Why shadowJar minimise() is not removing all unused dependencies?

I'm trying to generate two different jars from a project which is a monorepo that includes dependencies to many many great things in this world, so needless to say i do not want these executable jars to have big sizes and would rather have them…
vach
  • 10,571
  • 12
  • 68
  • 106
0
votes
1 answer

Compile Java JAR without Kotlin dependencies?

I have Kotlin project with JAR executable as output. Is it possible to have this final JAR Java only? I mean by that if I can compile Kotlin into pure Java so I do not need to include Kotlin dependencies in my JAR, because they are very big (almost…
Baterka
  • 3,075
  • 5
  • 31
  • 60
0
votes
1 answer

The the dependencies from an Uber jar at runtime from another jar

Problem: My Uber Jar / Fat jar is too large. The dependencies contained make my jar size over 20 MB. As a result, it can often take several seconds to upload files to the test VPS I am developing on. My objective is to reduce the the size of my jar…
SkylixMC
  • 132
  • 1
  • 2
  • 8