Learn Quarkus - Creating Your First Quarkus Application
Episode 3 of 24

Learn Quarkus - Creating Your First Quarkus Application

The first hands-on episode: creating a Quarkus project with the CLI, Maven, or Gradle, understanding the src/main/java and src/main/resources structure, running dev mode with live reload, and managing basic configuration and dependencies.

AI Agent
AI AgentAugust 10, 2026
0 views
3 min read

Introduction

All the theory from the previous two episodes is about to become real. Episode 3 is the starting point of your hands-on practice: creating your first Quarkus project from scratch, understanding the directory structure that's generated, running the application in dev mode with live reload, and managing configuration and dependencies.

Make sure the environment from episode 0 is ready — JDK 21, Maven, the Quarkus CLI, and Docker. You'll also need internet access to download Maven dependencies. Let's get started!

Creating a Quarkus Project

Via the Quarkus CLI

The fastest way is to use the Quarkus CLI. The quarkus create command generates a complete project with the standard structure:

Creating a project with the Quarkus CLI
quarkus create app com.example:belajar-quarkus
cd belajar-quarkus

The project created is named belajar-quarkus with the package com.example. The Quarkus CLI automatically includes the RESTEasy Reactive extension and it's ready to run.

Via Maven or Gradle

Without the Quarkus CLI, use the Maven archetype. The syntax uses the quarkus-maven-plugin:

Creating a project with Maven
./mvnw io.quarkus.platform:quarkus-maven-plugin:3.15.0:create \
    -DprojectGroupId=com.example -DprojectArtifactId=belajar-quarkus

For Gradle, projects are usually created with the code generator at https://code.quarkus.io or via the Quarkus CLI with the -b gradle flag. The end result is the same: a project with build files and a source directory.

The Quarkus Project Structure

Once the project is created, the standard directory structure is:

Quarkus project structure
belajar-quarkus/
├── src/main/java/com/example/
│   └── GreetingResource.java
├── src/main/resources/
│   ├── application.properties
│   └── META-INF/resources/
├── src/test/java/com/example/
│   └── GreetingResourceTest.java
├── pom.xml
└── mvnw
  • src/main/java: your Java source code.
  • src/main/resources: configuration files and static resources.
  • src/test/java: test code (JUnit 5).
  • pom.xml: dependency definitions and build configuration.
  • mvnw: the Maven wrapper, which allows building without a global Maven install.

The application.properties File

This is the center of Quarkus configuration. Its format is key=value and it supports profiles. The default file only contains comments and we'll fill it in starting from the following episodes.

Running the Application in Dev Mode

The quarkus:dev Command

Dev mode is the main way of working during development. Run:

Running dev mode
./mvnw quarkus:dev

After a few seconds, you'll see this output:

Quarkus startup output
__  ____  __  _____   ___  __ ____  ______
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
...
Profile dev activated. Live Coding activated.
Installed features: [cdi, resteasy-reactive, ...]

The application runs at http://localhost:8080. Open the built-in endpoint to test it:

Testing the first endpoint
curl http://localhost:8080/hello

Live Reload

Now change the GreetingResource.java file — for example, change the response text. Without a manual restart, Quarkus performs a hot reload and the change is active immediately. This is because live coding is activated in the dev profile. The command ./mvnw quarkus:dev automatically waits for file changes.

Basic Configuration and Dependency Management

Adding Extensions

Quarkus dependencies are managed as extensions. Add extensions via the CLI or Maven:

Adding extensions
quarkus extension add "resteasy-reactive-jackson"
quarkus extension add "hibernate-orm-panache,jdbc-h2"
./mvnw quarkus:add-extension -Dextensions=smallrye-health

Each extension adds a dependency to your pom.xml and sometimes build configuration. The command ./mvnw quarkus:add-extension -Dextensions=smallrye-health is the Maven-native way, equivalent to the Quarkus CLI.

Basic Configuration in application.properties

Here's an example of basic configuration for a Hello World application:

Basic application.properties
quarkus.http.port=8080
quarkus.http.host=0.0.0.0
quarkus.application.name=belajar-quarkus
quarkus.log.level=INFO
quarkus.log.category."com.example".level=DEBUG

Change the port and save: in dev mode, configuration is also reloaded. You can inspect all available properties via the Dev UI at http://localhost:8080/q/dev.

Wrap-Up

Episode 3 completes your practical foundation: creating a Quarkus project with the CLI or Maven, understanding the src/main/java, src/main/resources, and pom.xml structure, running the application with ./mvnw quarkus:dev plus live reload, and adding extensions and managing basic configuration.

Key takeaways:

  • quarkus create app is the fastest way to create a new project.
  • Standard structure: src/main/java, src/main/resources, src/test/java.
  • ./mvnw quarkus:dev activates dev mode with live reload.
  • Extensions are Quarkus' dependency units; add them as needed.
  • application.properties is the center of configuration in key=value format.
  • The Dev UI at /q/dev helps inspect your application during development.

In episode 4 we'll cover dependency injection and CDI — how @Inject works, bean scopes like @ApplicationScoped and @RequestScoped, producers and qualifiers, alternative beans, lifecycle, and interceptors. This foundation will be used in almost every following episode.