build.gradle
group 'gradle.demo'
version '1.0-SNAPSHOT'
buildscript {
repositories {
jcenter()
}
dependencies{
classpath 'org.akhikhl.gretty:gretty:1.2.4'
}
}
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'org.akhikhl.gretty'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile group : 'commons-collections', name: 'commons-collections',version: '3.2'
compile 'commons-httpclient:commons-httpclient:3.1'
compile 'org.springframework:spring-webmvc:4.3.6.RELEASE'
}
gretty {
port = 8080
contextPath ="/${project.name}"
servletContainer = 'jetty9'
}
运行命令: gradle appRun即可运行