Skip to content

Instantly share code, notes, and snippets.

@pgilad
Last active December 26, 2018 07:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pgilad/52d6d425d83a9c44a2a23149a1272349 to your computer and use it in GitHub Desktop.
Save pgilad/52d6d425d83a9c44a2a23149a1272349 to your computer and use it in GitHub Desktop.
How to create reproducible builds in spring using buildInfo
tasks.withType(AbstractArchiveTask) {
preserveFileTimestamps = false
reproducibleFileOrder = true
}
springBoot {
mainClassName = 'com.blazemeter.dagger.DaggerApplication'
buildInfo {
properties {
time = null
}
// Watch https://github.com/spring-projects/spring-boot/issues/14494
// Remove comments because they add modified timestamps
doLast {
File f = new File(destinationDir, 'build-info.properties')
f.text = f.filterLine { !it.startsWith('#') }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment