All appRunXXX and appStartXXX tasks have their debugging counterparts. For example, there are tasks appRun and appRunDebug. appRun starts web-app "normally", while appRunDebug starts web-app in suspended mode and listens for debugger commands on port 5005.

Fine-tuning

Gretty version 1.1.8+ implements two new properties, allowing fine-tuning of debug tasks:

gretty {
  debugPort = 5005      // default
  debugSuspend = true   // default
}

When defined, these properties affect all Gretty debug tasks (appRunDebug, appStartDebug, …​) of the given project.

Additionally, you can redefine these two properties on the level of the individual task:

gretty {
  afterEvaluate {
    appRunDebug {
      debugPort = 5005
      debugSuspend = true
    }
  }
}

Please note how appRunDebug task is configured within gretty.afterEvaluate closure: this guarantees that task exists at the moment of configuration.