Java applications - Maven package manager Debugger support

Hi Everyone,

i’m trying to get our java dev env to work in replit teams.

Our java app has a large classpath, the standard replit java template is not practical to run the app. The app is based on spring boot and we use the maven package manager to run it (which automatically takes care of the classpath).

The “run” function is working fine using the following .replit config:

# run via maven plugin: https://docs.spring.io/spring-boot/maven-plugin/run.html
run = "mvn spring-boot:run"

However the debugger is not working, the standard java template is using the following config

[debugger.interactive]
transport = "localhost:0"
connectTimeout = 60
startCommand = "java-debug"

[debugger.interactive.launchMessage.arguments]
classPaths = ["."]
mainClass = "Main"

The debugger is always stopped right after, indicating the app is not starting up correctly. I did adjust the settings to match our main class.

What would be ideal if we could launch the app in debug mode also via the mvn command:

[debugger.interactive]
transport = "localhost:5005"
connectTimeout = 120
startCommand = "mvn spring-boot:run -Dspring-boot.run.jvmArguments=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 && java-debug"

My understanding is that java-debug is based on the microsoft java-debug library

From the docs it should be possible to attach to a mvn run process instead of launching it via the java-debug tool, the setup for vscode is described here

Any hint on how to get debugging to work would be higly appreciated! I’m open to share more details about our setup if needed.

Thanks!