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

shadow jar to avoid dependency duplication in android studio

I am building an android application in android studio but am having trouble with duplicate dependencies. Duplicate class javax.inject.Inject found in modules jetified-javax.inject-1.jar (javax.inject:javax.inject:1) and…
2
votes
1 answer

How to run shadow jar with a gradle task?

I want to run my app after building it with the shadow jar plugin. build.gradle: plugins { id 'java' id "org.jetbrains.kotlin.jvm" version "1.3.21" id "com.github.johnrengelman.shadow" version "5.0.0" } group 'org.example.java' version…
Appyx
  • 1,145
  • 1
  • 12
  • 21
2
votes
0 answers

How add productionMode in shadowjar?

In my Vaadin project I use gradle. here my build.gradle: plugins { kotlin("jvm") version "1.3.20" id ("com.github.johnrengelman.shadow") version "4.0.3" id ("com.devsoap.vaadin-flow") version "1.0" id ("org.gretty") version…
Alexei
  • 14,350
  • 37
  • 121
  • 240
2
votes
1 answer

Unable to import ShadowJar plugin for Gradle in Intellij

I'm trying to set up the shadow jar plugin for use in my Gradle project. As according to the instructions, I'm importing it like so: plugins { id 'com.github.johnrengelman.shadow' version '4.0.2' } However, when the build starts, I get the…
SVill
  • 331
  • 5
  • 22
  • 55
2
votes
1 answer

How to use Launch4J with obfuscated jar in Gradle

I am trying to create an executable with Launch4J with my obfuscated jar but I have a problem. Every time I run the createEXE task via Gradle, the shadowJar task also runs causing my obfuscated jar to be overwritten. How to I use my obfuscated jar…
Osher Shuman
  • 213
  • 3
  • 7
2
votes
1 answer

Max size of a fat JAR for Apache Flink

I've build an Apache Flink app and packaged it in a fat JAR with Gradle Shadow Plugin. The resulting file size is ~114 MiB. When I'm trying to upload it with Flink's web UI it is stuck in "Saving…" phase. And if I use curl to upload it manually the…
madhead
  • 31,729
  • 16
  • 153
  • 201
2
votes
1 answer

Ratpack + Thymeleaf + shadowJar - Error resolving template "home", template might not exist or might not be accessible

I'm working on ratpack.io web app and using gradle as the build tool. Templates are rendered from template files in a src/main/thymeleaf directory, which works fine at runtime (just using gradle run). $ ls ./src/main/thymeleaf home.html I'm…
voodoogiant
  • 2,118
  • 6
  • 29
  • 49
2
votes
2 answers

How to publish a fat JAR to JitPack using shadowJar gradle plugin and not maven publish

It's not immediately intuitive on how to publish a fat JAR to JitPack because the shadow docs don't have a section for JitPack and the JitPack docs don't have a section on fat jars. All the docs say is that if you include maven-publish then they…
fIwJlxSzApHEZIl
  • 11,861
  • 6
  • 62
  • 71
2
votes
1 answer

shadow plugin in gradle is not working - gradle build does not build a fat jar

I have the following build.gradle content: group 'com.example' version '1.0-SNAPSHOT' buildscript { repositories { mavenLocal() mavenCentral() jcenter() maven { url "https://plugins.gradle.org/m2/" } } …
Joey Baruch
  • 4,180
  • 6
  • 34
  • 48
2
votes
1 answer

Compile gradle with two configuration

I have a gradle project. This project contains many modules. I would like to make 2 differents executables with some module activated or not. I have one executable with module1 and module2 like follow: dependencies { compile project(':module1') …
Barthos33
  • 19
  • 2
2
votes
1 answer

Gradle :: runtime.exclude group: 'org.apache.hadoop' affects test scope?

I have the following in my build.gradle: configurations { runtime.exclude group: 'org.apache.spark' runtime.exclude group: 'org.apache.hadoop' } and for some reason this also excludes all Hadoop/Spark code from the test classpath. If I comment…
jdevelop
  • 12,176
  • 10
  • 56
  • 112
1
vote
1 answer

How can I run my Gradle application on a separate machine without having to use a shadowJar?

I have a Gradle project with a good few dependencies, and a fresh server Ubuntu distro. As of now, I'm using Shadow to build a shadowJar, and a deploy this to the server, as dependencies are built in. However, with all of the dependencies the file…
LetsdothisEpic
  • 126
  • 1
  • 6
1
vote
0 answers

Docker build stuck in Gradle task

When I try to run this Docker image it stays stuck forever: FROM gradle:7.4.2-jdk11 as build ENV GRADLE_OPTS="-Dorg.gradle.daemon=false" WORKDIR /usr/src/app COPY . . RUN ./gradlew shadowJar FROM adoptopenjdk:latest WORKDIR /usr/src/app COPY…
Luís Soares
  • 5,726
  • 4
  • 39
  • 66
1
vote
1 answer

Unable to build FatJAR using the shadowJar plugin in Gradle

I have tried pretty much everything and for some reason, no JAR file gets built under my build folder. Here is build.gradle: plugins { id 'java' id 'com.github.johnrengelman.shadow' version '7.0.0' } group 'org.prithvidiamond1' version…
Prithvidiamond
  • 327
  • 2
  • 15
1
vote
0 answers

Elastic Search gradle fails to build shadowJAR

I am new to Elastic Search. I downloaded the sources last night so that I can compile and take a look at the code, perhaps to contribute if I feel I can do so. I almost got it compiling on OpenSuse 15.2 except that I keep running against the…
wblades
  • 64
  • 4