Last active
December 26, 2018 07:33
-
-
Save pgilad/52d6d425d83a9c44a2a23149a1272349 to your computer and use it in GitHub Desktop.
How to create reproducible builds in spring using buildInfo
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
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