Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// new Gradle build tasks
task warNoStatic(type: War) {
// omit the version from the war file name
version = ''
exclude '**/assets/**'
manifest {
'Manifest-Version': '1.0',
'Created-By': currentJvm,
'Gradle-Version': GradleVersion.current().getVersion(),
'Implementation-Title': archivesBaseName + '.war',
'Implementation-Version': artifact_version,
'Implementation-Vendor': 'Gary A. Stafford'
task warCopy(type: Copy) {
from 'build/libs'
into 'build/distributions'
include '**/*.war'
task zipGetVersion (type: Task) {
ext.versionfile =
new File("${projectDir}/src/main/webapp/assets/")
versionfile.text = 'build.version=' + artifact_version
task zipStatic(type: Zip) {
from 'src/main/webapp/assets'
appendix = 'static'
version = ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment