This project demonstrates how to create a shadow jar, also known as fat jar or uber jar with the Javalin library as an example.
- Java 17
- Gradle 8 (provided by the Gradle Wrapper ./gradlew)
- Gradle Shadow Plugin
Run ./gradlew shadowJar
. The resulting jar file app/build/libs/app-all.jar
can now be run with
java -jar app/build/libs/app-all.jar
when inside the default working directory.
./gradlew shadowJar
cd app/build/libs
java -jar app-all.jar