I'm using s/o code, it's a java webapp built by maven. The webapp is run by maven script, like below, and the app is run on localhost:8080, :
<build> <plugins> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>8.1.8.v20121106</version> <configuration> <contextPath>/</contextPath> <connectors> <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector"> <!--<port>8085</port>--> <port>8080</port> <maxIdleTime>60000</maxIdleTime> </connector> </connectors> <stopKey>stop</stopKey> <stopPort>8089</stopPort> </configuration> </plugin> </plugins> </build>
I want to attach the debugger of IntelliJ so that I can step through the code. I tried to set up a debugger configuration like: Jetty Server, then 'Remote' but it said Application Server not specified. I also tried with 'Local', it said 'main config file not included'.
So what must I do to attach the debugger? Thanks in advance.
You could use your Jetty Server in Intellij IDEA using a Run/Debug Configuration : Run > Edit Configurations... > + > Jetty Server > Local. Then you can add artifacts (war exploded) that will be deployed on your jetty and then simply launch it via Debug (doc here). Did you already try this ?
The easiest way is to:
Maven Projects
tab.Plugins
> jetty
items.jetty:run
.Debug
from the context menu.I know it's too late to reply this question, but It's worth sharing the latest update on this issue as a modern solution: You can also run jetty using “mvnDebug jetty:run
” which has the same effect. Which display the following logs in the terminal
Preparing to Execute Maven in Debug Mode Listening for transport dt_socket at address: 8000 [INFO] Scanning for projects...
Just remember to choose the correct socket address(e.g. 8000), then:
Enjoy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With