Created
May 7, 2014 06:33
-
-
Save sjyun/62217adf6891abaca6af to your computer and use it in GitHub Desktop.
servlet3.0 build.gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'java' | |
apply plugin: 'war' | |
apply plugin: 'eclipse' | |
apply plugin: 'eclipse-wtp' | |
apply plugin: 'jetty' | |
sourceCompatibility = 1.7 | |
targetCompatibility = 1.7 | |
compileJava.options.encoding = 'UTF-8' | |
buildDir = 'build' | |
repositories { | |
jcenter() | |
mavenCentral() | |
} | |
dependencies{ | |
providedCompile 'javax.servlet:javax.servlet-api:3.1.0' | |
} | |
task initProject << { | |
createDir = { | |
it.mkdirs(); | |
} | |
sourceSets.main.resources.srcDirs = ["src/main/resources"] | |
sourceSets*.java.srcDirs*.each createDir | |
sourceSets*.resources.srcDirs*.each createDir | |
createDir webAppDir | |
createDir new File(webAppDir, '/WEB-INF/views'); | |
processResources { | |
from(sourceSets.main.resources.srcDirs) { | |
} | |
} | |
} | |
eclipse{ | |
classpath { | |
downloadSources = true | |
downloadDoc = true | |
defaultOutputDir = file("${buildDir}/classes/main") | |
} | |
jdt{ | |
sourceCompatibility = 1.7 | |
targetCompatibility = 1.7 | |
} | |
wtp{ | |
component{ | |
contextPath ='/' | |
} | |
facet{ | |
facet name :'jst.web', version:'3.0' | |
facet name : 'jst.java', version:'1.7' | |
} | |
} | |
} | |
tasks.eclipse.dependsOn initProject | |
tasks.eclipse.dependsOn cleanEclipse |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment