Skip to main content

Packaging

The platform, or a single module, can be packaged in several forms. Each has a Maven profile.

FormCommandUse
Library JARmvn packageThe default. Integration into another project; needs the Quarkus dependencies at run time.
Fat JARmvn package -PfatOne executable JAR with all dependencies included
Containermvn package -PjibDeployment with Docker Compose or Kubernetes
Container with native imagemvn package -PnativeContainer holding a native executable
Container for remote developmentmvn package -PremotePushing local code changes to a running container

Use the container profiles for any deployment with Docker Compose or Kubernetes.

Fat JAR​

A fat JAR, or uber-JAR, holds the code of the application together with all its dependencies in a single executable file.

  • Self-contained. It runs on any Java virtual machine with nothing else to install.
  • Simple to deploy. There is one file to ship.
  • Large. The file grows with the number of dependencies.

Build it from a module, from the launcher or from the root of the repository:

mvn package -Pfat

The file is written to the target directory and starts with java -jar. For the catalog module:

java -jar ./modules/applications/mediacentre/target/catalog-1.0-SNAPSHOT-runner.jar

Container​

Containers are built with Jib, which builds images without a Dockerfile, on top of a maintained base image that receives security patches.

From the root of the repository:

mvn package -Pjib

Set the version of the container and publish it to a registry in the same command:

mvn package -Pjib -Dquarkus.container-image.tag=1.0 -Dquarkus.container-image.push=true -Dmaven.test.skip=true

By default, containers are published to the GitHub container registry of the project, which only contributors can write to. Otherwise, either disable the push:

-Dquarkus.container-image.push=false

or name your own registry:

mvn package -Pjib -Dquarkus.container-image.build=true -Dquarkus.container-image.push=true -Dquarkus.container-image.registry=docker.io -Dmaven.test.skip=true

Native image​

A native image is a Quarkus application compiled ahead of time with GraalVM into a standalone executable for the target operating system.

  • Fast startup, in milliseconds, which suits containers and autoscaling.
  • Low memory use, since only what the application needs is included.
  • No Java virtual machine required at run time.

Container for remote development​

In this mode, code is edited locally and pushed straight into the container running on the server. It speeds up work on a fix that depends on a specific environment.

Containers built for remote development carry the -dev suffix in their version, which the Helm chart relies on:

mvn package -Dquarkus.container-image.build=true -Dquarkus.container-image.tag=1.0.1-dev -Dquarkus.container-image.push=true -Dmaven.test.skip=true -Premote

With such a container deployed, start live reload from the module's directory:

mvn quarkus:remote-dev -Dquarkus.live-reload.url=https://openent.example.org -Dquarkus.live-reload.password=openent -Premote