Alternatively, instead of mvn jetty:run
, use this command without the need to set MAVEN_OPTS
:
mvnDebug jetty:run
Here's the reference.
In my case, I am using VS Code. When I run the command, the terminal would only show:
Preparing to execute Maven in debug mode
Listening for transport dt_socket at address: 8000
and wait until I click the Start Debugging button (after adding and the corresponding configuration in launch.json
and selecting it)
Below is the configuration I used, just in case.
{
"type": "java",
"name": "Attach to Remote",
"request": "attach",
"hostName": "localhost",
"port": 8000,
"projectName": "your-project-name" // Optional: Replace with your project name
}