Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I debug my Quarkus application that is running in dev mode?

Tags:

quarkus

I have launched my application using the Quarkus dev mode (mvn quarkus:dev) and I would like to be able to debug it.

How can do that?

like image 309
geoand Avatar asked Mar 15 '19 20:03

geoand


1 Answers

When launching a Quarkus app simply using mvn quarkus:dev, the running application is configured to open port 5005 for remote debugging. That means that all you have to do is point your remote debugger to that port and you will be able to debug it in your favorite IDE/lightweight editor.

If however you would like to be able to suspend the application until a debugger is connected then simply execute:

mvn quarkus:dev -Ddebug

The same port is used (5005) but this time the application doesn't start until a remote debugger is connected.

UPDATE

Since Quarkus 0.24 the flag that causes the application to suspend until a debugger is connected is -Dsuspend instead of -Ddebug (which can still be used to change the debug port but no longer prevents the application from starting until a debugger connects).

UPDATE 2

As of version 2020.3, IntelliJ Ultimate should recognize a quarkus application and automatically create a launch configuration that uses quarkus:dev under the hood.

like image 190
geoand Avatar answered Sep 25 '22 16:09

geoand