Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build a debug environment for Quarkus

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report