Search⌘ K
AI Features

Configuring a Quarkus Application

Explore how to configure a Quarkus application using various methods such as system properties, environment variables, .env files, and configuration files in .properties or .yaml formats. Understand how to inject and use custom properties within your code to customize application behavior.

Introduction

Quarkus offers multiple ways to configure our application. The most common include:

  • System properties
  • Environment variables
  • An .env file in the working directory
  • A Quarkus application file (.properties or .yaml file)

System properties

System properties are passed to a Quarkus application with the -D flag when running our application.

When working with the developer tools, we can pass all kinds of properties. For example, when we created our application, we used the below command to generate the source code:

Shell
mvn io.quarkus.platform:quarkus-maven-plugin:2.15.3.Final:create \
-DprojectGroupId=io.educative \
-DprojectArtifactId=maven-test

The example above uses Maven to create a new Quarkus application while passing the ...