gradle tomcatStartWar
tomcatStartWar starts web-app on WAR-file.
The web-app gets compiled and assembled into WAR-file (if it’s not up-to-date).
Embedded servlet-container starts in separate java process against WAR-file and listens for HTTP-requests on port (default 8080).
Gretty waits for servlet-container process to complete.
Gradle script continues normal execution of tasks.
Note that this task does not stop Tomcat. It is assumed that another gradle process stops it, supposedly gradle tomcatStop.
The object called tomcatStartWar is actually an instance of TomcatStartTask 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.TomcatStartTask
task('MyRun', type: TomcatStartTask) {
// ...
}
class VerySpecialRun extends TomcatStartTask {
// ...
}
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.
See also: tomcatStop task and tomcatRestart task.