Last active
November 20, 2017 04:57
-
-
Save shafinmahmud/8808fccece00e690d0aecfabab2c700a to your computer and use it in GitHub Desktop.
Sample Java Web application build script with 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' | |
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