Description
Is your feature request related to a problem? Please describe.
To meet the requirements of Reproducible Builds, generated timestamps should be predicable (so that packages can be rebuild with the same source and produce the same output)
Describe the solution you'd like
For projects using the Maven plugin, this could mean that the generatedDate
would be set to Maven's project.build.outputTimestamp
property.
Gradle's approach to this is to use a fixed date:
https://github.com/gradle/gradle/blob/f4fcd0b4f2c6a1903f80a4299a540d73d722f127/platforms/core-runtime/files/src/main/java/org/gradle/api/internal/file/archive/ZipEntryConstants.java#L24-L39
Describe alternatives you've considered
Alternatively configOptions.hideGenerationTimestamp
could be set to true
by default.
Another alternative would be to use the timestamp of the openapi spec file. There are a lot of edge cases around this, the file could be downloaded and timestamp not preserved, file could be copied at build time (and timestamp not preserved). Additionally, other inputs to the generator could change resulting in different code using the same source spec. So this probably isn't a valid option.
Additional context
See:
- Maven Artifact Plugin (list of non-compliant and fixed plugin versions)
- Maven Reproducible Builds Guide
- Maven Reproducible Builds wiki page