0

I am trying to debug maven project with Jetty server in eclipse (Spring Tool Suite Version: 3.4.0). I have added the below in my POM.xml

-javaagent:"${settings.localRepository}/org/springframework/spring-instrument/${spring.version}/spring-instrument-${spring.version}.jar" -agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n

MAVEN_OPTS

-Xmx512m -XX:MaxPermSize=256m -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y

I start the server with jetty:run-forked

I have created a new debug configuration - Remote Java Application with below attributes, Connection type : Standard (Socket Attach) Host: Localhost Port: 8000

The server gets started and I could run the application but the debug is not working. (I have already verified skip breakpoints it's unchecked)

I have also referred the below questions but the issue is not resolved yet. Please help.

Question1

Question2

Community
  • 1
  • 1
explorer
  • 1,074
  • 2
  • 11
  • 31

1 Answers1

0

Don't use jetty:run-forked as that will spawn a new JVM.

The process of forking a new JVM means that the maven JVM settings will not propagate.

It can't propagate those settings (like port), as they are now used by the maven JVM, and cannot be used by the forked JVM (eg: Bind Exception).

Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136