为Gradle安装Tomcat插件
1.首先去这里下载
https://github.com/bmuschko/gradle-tomcat-plugin
?
2.然后建立build.gradle 采用本地方式添加,完毕后执行gradle即可,也可以按照官方说明采用远程添加
?
buildscript {
?
repositories {?
flatDir dirs: "${gradle.gradleHomeDir}/customPlugins"?
}?
?
? ? dependencies {
? ? ? ? classpath 'bmuschko:gradle-tomcat-plugin:0.9.5'
? ? }
}
apply plugin: 'tomcat'
?
---官方样例
buildscript { repositories { add(new org.apache.ivy.plugins.resolver.URLResolver()) { name = 'GitHub' addArtifactPattern 'http://cloud.github.com/downloads/[organisation]/[module]/[module]-[revision].[ext]' } } dependencies { classpath 'bmuschko:gradle-tomcat-plugin:0.9.5' }}
repositories { mavenCentral()}dependencies { def tomcatVersion = '6.0.29' tomcat "org.apache.tomcat:catalina:${tomcatVersion}", "org.apache.tomcat:coyote:${tomcatVersion}", "org.apache.tomcat:jasper:${tomcatVersion}"}