Khoulaiz / gradle-jetty-eclipse-plugin

Gradle Jetty Plugin for Eclipse Jetty

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Debugging with Eclipse

MBurchard opened this issue · comments

In on older project I used a standard Java main class to start jetty.
Here it's possible to add breakpoints everywhere in the project and start in debug mode.

Then I fond this nice Gradle Eclipse plugin?
Is there any way to use the plugin and start in debug mode?
I thought I wouldn't need my jetty starter class any more.

Just start the build itself in debug mode by adding something like this to your start command:
GRADLE_OPTS='-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005' gradle jettyEclipseRun.
Set your breakpoints and connect the debugger on port 5005.

Sounds good, haven't done this before with Gradle. Just used Gradle IDE, clicking a Gradle task and waiting until it's finished...

I opened a terminal (Ubuntu)
GRADLE_OPTS='-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005' ./gradlew jettyEclipseRun
I created a Debug Configuration in Eclipse for a remote Java Application and started it.
It works, debugging was possible, but the log output was in the console, not in Eclipse.
The task jettyEclipseStop works from inside Eclipse.

Is there an easier way? May be starting the jettyEclipseRun from Eclipse with remote debugging in one Step?