Skip to content

Instantly share code, notes, and snippets.

@shafinmahmud
Last active November 20, 2017 04:57
Show Gist options
  • Save shafinmahmud/8808fccece00e690d0aecfabab2c700a to your computer and use it in GitHub Desktop.
Save shafinmahmud/8808fccece00e690d0aecfabab2c700a to your computer and use it in GitHub Desktop.
Sample Java Web application build script with Gradle
apply plugin: 'java'
apply plugin: 'war'
group = 'sample.web'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
targetCompatibility = 1.8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
/* Copying war file to outer release directory
* tested in Gradle version 4.3 and later */
task release(type: Copy) {
from war.archivePath
into 'release/' + version
include '*.war'
}
repositories {
maven { url "http://repo.maven.apache.org/maven2" }
}
dependencies {
compile group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0'
compile group: 'jstl', name: 'jstl', version: '1.2'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment