Create Quarkus Project With code.quarkus.io: Hello world example
In this article, we will learn how to create a simple Quarkus project with code.quarkus.io. code.quarkus.io is a great tool to quickly bootstrap your Quarkus projects.
More Quarkus Related topics,
- QUARKUS + Hibernate CRUD example - Creating a CRUD REST API/Service
- Build REST CRUD APIs with Quarkus and MyBatis
- Create Quarkus Project With code.quarkus.io: Hello world example
- Quarkus - How to send email via SMTP - Quickstart
- Quarkus - Qute - Hello World Example
- Quarkus + Maven Hello World Example
- Configuring the HTTP Port on Quarkus Applications
- Quarkus - Interview questions and answers
Let's create a Quarkus project step by step.
Step 1. Launch Quarkus Initializr using https://code.quarkus.io/ link
Step 2. Specify Project Details
Look at the above diagram, we have specified the following details:
- Build Tool: Maven
- Group: org.knf.dev.demo
- Artifact: code-with-quarkus
- Search & Pick extensions: RESTEasy JSON-B
Once, all the details are entered, click on Generate your application button will generate a Quarkus project and downloads it. Next, Unzip the downloaded zip file and import it into your favourite IDE.
Step 3. Import project in your favorite IDE.I am using IntelliJ IDEA.
In IntelliJ IDEA, Click Open
Navigate to the path of the folder where you extracted the zip file.
Quarkus Hello world example
Project Structure:
Quarkus JAX-RX endpoint
package org.knf.dev.demo;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
@Path("/hello")
public class GreetingResource {
@GET
@Produces(MediaType.TEXT_PLAIN)
public String hello() {
return "Hello RESTEasy";
}
}
Testing
Build application jar file: mvn clean package
Start application: java -jar quarkus-run.jar
Start application: java -jar quarkus-run.jar
Open the browser and hit the endpoint localhost:8080/api/hello
Download the source code:
More Quarkus Related topics,
- QUARKUS + Hibernate CRUD example - Creating a CRUD REST API/Service
- Build REST CRUD APIs with Quarkus and MyBatis
- Create Quarkus Project With code.quarkus.io: Hello world example
- Quarkus - How to send email via SMTP - Quickstart
- Quarkus - Qute - Hello World Example
- Quarkus + Maven Hello World Example
- Configuring the HTTP Port on Quarkus Applications
- Quarkus - Interview questions and answers