Quarkus Cheatsheet (2022)

Here is a simple cheatsheet that will help you as reference guide to build your Quarkus applications. To learn how to install the Quarkus CLI we recommend to read this article: What’s new with Quarkus 2.0 and how to get started quickly).

Project setup

On-line project creator: https://code.quarkus.io/

Create a Quarkus basic REST project named “code-with-quarkus”

quarkus create

Create a Quarkus project using a specific BOM version:

quarkus create -P io.quarkus.platform:quarkus-bom:2.7.1.Final

Create a project using the Maven GAV com.foo:bar:1.0

quarkus create app com.foo:bar:1.0

Create a project using a Template:

#create a CLI project
quarkus create cli

#create an extension project
quarkus create extension

Add / Remove extensions to a Quarkus project

# Add extension
quarkus ext add kubernetes health

# Remove extension
quakus ext rm health

List available extensions for a search pattern (e.g. hibernate extensions)

quarkus ext list  -i -s hibernate

Build a Quarkus application

quarkus build

Run application in dev mode

quarkus dev

Run application in prod mode

java -jar target/quarkus-app/quarkus-run.jar


The default configuration file is available in the folder src/main/resources/application.properties

Example: How to change the default HTTP Port:


To Inject a System Property in your code, use the following annotation:

@ConfigProperty(name = "greeting" , defaultValue="hello") String greeting;

To list all available Configuration Options check this link: https://quarkus.io/guides/all-config

Using Profiles in your configuration

#Default profile. Used if there isn't a specific active profile for this property

#Dev profile. Used in dev mode

#Prod Profile. Used in prod mode

#Test Profile. Used in test mode

#Custom profile. Requires -Dquarkus-profile=custom 

Database Access

Sample configuration for H2 Database (default profile):


Sample configuration for PostgreSQL Database (prod profile)



Native executable

Build a native executable application (Using Docker Image of GraalVM)

service docker start

quarkus build --native -Dquarkus.native.container-build=true