You can use tomcat plugin with gradle. For more information, you here.
apply plugin: 'tomcat'
dependencies {
classpath 'org.gradle.api.plugins:gradle-tomcat-plugin:1.2.4'
}
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
[tomcatRun, tomcatRunWar, tomcatStop]*.stopPort = 8090
[tomcatRun, tomcatRunWar, tomcatStop]*.stopKey = 'stfu'
tomcatRunWar.contextPath = "/$rootProject.name"
tomcatRunWar.ajpPort = 8000
if (checkBeforeRun.toBoolean()) {
tomcatRunWar { dependsOn += ['check'] }
}