Skip to content

[REQ] Generated date should be reproducible (or disabled by default) #21066

Open
@bdemers

Description

@bdemers

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.

config.additionalProperties().put("generatedDate", ZonedDateTime.now().toString());

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:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions