Get the App
SLTechnology News&Howtos  ›  Development  › 

How to build a debug environment for Quarkus

Shulou Source: shulou.com Published: 2022-06-01 12:58:38 09月16日 Update

Today, I would like to share with you the relevant knowledge about how to build a debug environment in Quarkus. The content is detailed and the logic is clear. I believe most people still know too much about this, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

Set up Quarkus project

Here are three ways to create a Quarkus project

Pure manual method

1. Create a maven project, which does not go into much detail, and is what a java programmer can do

2. Add Quarkus dependencies. Basic dependencies are posted below.

1.6.0.Final 1.6.0.Final 2.22.1 3.8.0 UTF-8 UTF-8 io.quarkus quarkus-bom ${quarkus.platform.version} import pom Io.quarkus quarkus-resteasy-jsonb io.quarkus quarkus-junit5 test io.rest-assured rest-assured test org. Apache.maven.plugins maven-compiler-plugin ${compiler-plugin.version} 1.81.8 true Maven-surefire-plugin ${surefire-plugin.version} org.jboss.logmanager.LogManager ${maven.home} Io.quarkus quarkus-maven-plugin ${quarkus-plugin.version} build official website assembler mode

The usage is the same as the https://start.spring.io/ of spring. Fill in your basic maven information and select the dependencies to download the project.

IDEA mode

IDEA already supports the creation of Quarkus projects, which, like the principle of spring boot, is also based on https://code.quarkus.io/, so it operates in the same way as on web pages, such as:

Write the first Quarkus interface @ Produces (MediaType.TEXT_PLAIN) @ Path ("/ hello") public class HelloResource {@ GET @ Path ("/ {name}") public String hello (@ PathParam ("name") String name) {return "hello" + name;}}

Quarkus writes web based on the standard jax-rs specification. Of course, it also extends spring web's @ Controller way, which will be described later.

Start your application and debug

1. By running mvn quarkus:dev, you can start the application. After starting the application, you will find that the application is printed:

Listening for transport dt_socket at address: 5005

Indicates that the 5005 debug port is open. In IDEA, you can use the

Run- "Attach to process

To directly connect to this port for debugging

2. You can create a new main method and start it in debug mode directly to run and debug, such as:

@ QuarkusMainpublic class Main {public static void main (String... Args) {Quarkus.run (args);}} these are all the contents of the article "how to build a debug environment for Quarkus". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Tags: Way knowledge article project application environment content engineering port UTF-8 run different big information principle can be passed basic most that is manual Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Linux Shulou Information OPPO Reno MariaDB