Does anyone know how to configure the jetty gradle plugin to run in debug mode so that I can attach a remote debugger?
I\'ve tried setting the gradle and java opts t
Are you running gradle in daemon mode? As I understand it the daemon will then be running the jetty instance. Therefore you'll need to set the JVM args for the daemon. This should be possible by setting the org.gradle.jvmargs in gradle.properties.
See http://gradle.org/docs/current/userguide/tutorial_this_and_that.html#sec:gradle_properties_and_system_properties
Simply project that works here in non-daemon mode
build.gradle:
apply plugin: 'idea'
apply plugin: 'jetty'
src/main/java/com/Test.java:
package com;
public class Test {
static public String greet() {
return "Hi";
}
}
src/main/webapp/index.jsp:
<%@ page import="com.Test" %>
<%= Test.greet() %>
Command-line (in cygwin though):
$ GRADLE_OPTS='-Xdebug -Xrunjdwp:transport=dt_socket,address=9999,server=y,suspend=n' gradle jettyRun
Gradle then hangs and I can put debugger from Intellij on port 9999 and set a breakpoint in the java file. When I then try to open the web page jetty informs me about I will hit the breakpoint.