appRunWarDebug starts web-app on WAR-file, in debug and interactive mode.

Syntax

gradle appRunWarDebug

Effects

  1. The web-app gets compiled and assembled into WAR-file (if it’s not up-to-date).

  2. Embedded servlet-container starts in separate java process against WAR-file.
    important: Upon start, the process is in suspended-mode and listens for debugger commands on port 5005.

  3. Upon resume, servlet-container process starts listening for HTTP-requests on port (default 8080).

  4. Gretty waits for the user keypress.

  5. When user presses any key (in the same terminal), servlet-container process shuts down.

  6. Gretty waits for servlet-container process to complete.

  7. Gradle script continues normal execution of tasks.

Instantiation and extension

The object called appRunWarDebug is actually an instance of AppStartTask class, created and configured for you by Gretty. You can instantiate or even extend this class on your own:

apply plugin: 'org.akhikhl.gretty'

import org.akhikhl.gretty.AppStartTask

task('MyRun', type: AppStartTask) {
  // ...
}

class VerySpecialRun extends AppStartTask {
  // ...
}

task('MyRun2', type: VerySpecialRun) {
  // ...
}

If you are going to instantiate or extend this task class yourself, make sure you’ve learned it’s properties and methods.

Workflow

appRunWarDebug StateDiagram

See also: Debugger support.