For Gradle, refer to the following URL:
Gradle plugin portal: https://plugins.gradle.org/
For Gretty, refer to the following URL:
Gretty plugin: https://plugins.gradle.org/plugin/org.akhikhl.gretty
Gretty documentation: http://akhikhl.github.io/gretty-doc/
There are various plugins available to automate the deployment. Some of them are listed here:
Cargo plugin: https://github.com/bmuschko/gradle-cargo-plugin
Arquillian plugin: https://github.com/arquillian/arquillian-gradle-plugin
Tomcat plugin: https://github.com/bmuschko/gradle-tomcat-plugin