Java

Quarkus CLI

Command line tool for creating, building, and managing Quarkus projects.

#java #quarkus #cli #build #native

Project Initialization

Create New Application

Scaffolds a new Quarkus application project.

Parameters:

ParameterDescriptionNaming RulesExample
group_idUniquely identifies your projectReversed domain name (avoid uppercase)org.acme
artifact_idName of the generated application/jarAll lowercase, hyphens for spaces (kebab-case)my-quarkus-app
quarkus create app [group_id]:[artifact_id]

Create with Specific Extensions

Creates a project with pre-selected extensions.

quarkus create app [group_id]:[artifact_id] \
    --extension=[extension_name]

Create CLI Application

Creates a command-line application project.

quarkus create cli [group_id]:[artifact_id]

Specify Build Tool

Create a project explicitly using Gradle (Kotlin DSL) or Maven.

Use Gradle with Kotlin DSL.

quarkus create app [group_id]:[artifact_id] --gradle-kotlin

Use Maven.

quarkus create app [group_id]:[artifact_id] --maven

Development Mode

Start Dev Mode

Runs the application in development mode with live coding enabled. Changes are reflected immediately.

quarkus dev

Clean Dev Mode

Forces a clean build before starting dev mode.

quarkus dev --clean

Suspend Debugger

Starts dev mode but waits for a debugger to attach before running (default port 5005).

quarkus dev --debug --suspend

Extension Management

List Extensions

Lists all available extensions or those installed in the current project.

List all installable extensions.

quarkus ext list

List installed extensions.

quarkus ext list --installed

Add Extension

Adds a dependency to your build file.

quarkus ext add [extension_name]

Remove Extension

Removes a dependency from your build file.

quarkus ext remove [extension_name]

Building and Packaging

Standard Build

Builds the application (fast-jar by default).

quarkus build

Native Image Build

Compiles the application into a native executable (requires GraalVM or Docker).

quarkus build --native

Native Build with Container

Builds a native executable using a container runtime (Docker/Podman), removing the need for local GraalVM.

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

Skip Tests

Builds the project without running tests.

quarkus build -DskipTests

Configuration

Set Configuration Property

You can override configuration properties at runtime or build time using flags.

quarkus dev -Dquarkus.http.port=8090

Specify Profile

Run or build with a specific profile (e.g., prod, dev, test).

quarkus build -Dquarkus.profile=prod

Common Extensions

Here are some frequently used extensions to add:

  • quarkus-resteasy-reactive: REST API support (blocking & non-blocking)
  • quarkus-resteasy-reactive-jackson: JSON serialization
  • quarkus-jdbc-postgresql: PostgreSQL driver
  • quarkus-hibernate-orm-panache: Simplified JPA/Hibernate data access
  • quarkus-smallrye-health: Health checks
  • quarkus-smallrye-openapi: Swagger/OpenAPI documentation

Resources