Add the following to "build.gradle" of your web-app:

apply plugin: 'war'
apply from: 'https://raw.github.com/gretty-gradle-plugin/gretty/master/pluginScripts/gretty.plugin'

That’s all! Now you can start your web-app with the command:

gradle appRun

you can also use other Gretty tasks for running and debugging your web-app or configure Gretty to your needs.

Alternatively, you can download the script from https://raw.github.com/gretty-gradle-plugin/gretty/master/pluginScripts/gretty.plugin to the project folder and include it like this:

apply from: 'gretty.plugin'

or feel free inserting to your "build.gradle":

buildscript {
  repositories {
    jcenter()
    // enable this to use snapshot versions of Gretty:
    // maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
  }

  dependencies {
    classpath 'org.gretty:gretty:+'
  }
}

repositories {
  jcenter()
  // enable this to use snapshot versions of Gretty:
  // maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
}

apply plugin: 'org.gretty'
Note
All release versions of Gretty are available at jcenter and maven central under the group 'org.gretty'.
Note
Snapshot versions of gretty are available at jfrog artifactory (see code above).
Important
If you experience problems starting Gretty, first look into troubleshooting section. If it does not help, raise an issue at Gretty issue tracker or send an email to Gretty developer.