This showcase how to build a Spring-Boot application with JeKa with default options. It also outlines how a building docker and native images can be achieved at no additional cost.
We don't need Java code to configure the build : all configuration lies in dependencies.txt and jeka.properties.
Create jar
jeka project: pack
Clean and Create a bootable jar.
jeka project: pack --clean
Create bootable jar skipping tests
jeka project: pack "-Djeka.skip.tests=true" --clean
Run jar
jeka project: runJar run.programArgs="" run.jvmOptions=""
Synchronize IntelliJ
jeka intellij: iml
The following commands requires a Docker cli (such as Docker Desktop) on the host.
Create a Docker Image of the Spring-Boot Application.
jeka docker: build
Show Details about of the Docker Image.
jeka docker: info
Native compilation does not have any requisite.
Create a Docker Image containing the Native Executable of the Application (smaller and faster).
jeka docker: buildNative
Create a minimalist native Docker Image:
jeka docker: buildNative nativeBaseImage=gcr.io/distroless/static-debian12:nonroot native: staticLink=MUSL
Execute the Docker Image:
docker run --rm -p 8080:8080 native-demo-springboot-simple:latest
Show Details about of the Docker Native Image:
jeka docker: infoNative