Skip to content

Instantly share code, notes, and snippets.

@arthurtsang
Created February 8, 2015 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arthurtsang/a0f4db90e175481c71f5 to your computer and use it in GitHub Desktop.
Save arthurtsang/a0f4db90e175481c71f5 to your computer and use it in GitHub Desktop.
gradle shadow plugin with build date in manifest
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'io.ratpack:ratpack-gradle:0.9.13'
classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.0'
}
}
apply plugin: "io.ratpack.ratpack-java"
apply plugin: "com.github.johnrengelman.shadow"
version = '1.0'
mainClassName = 'com.acme.core.AppMain'
import java.text.SimpleDateFormat
shadowJar {
mergeServiceFiles()
manifest {
attributes 'Built-Date': (new SimpleDateFormat("yyyy/MM/dd")).format(new Date()) //today's date
attributes 'Built-By': System.getProperty('user.name')
attributes 'Build-Jdk': System.getProperty('java.version')
attributes 'Implementation-Title': project.name
attributes 'Implementation-Version': project.version
attributes 'Implementation-Vendor-Id': project.group
}
exclude 'server.log'
exclude '*.log.gz'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment