Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow initial git.build.time from project.build.outputTimestamp to support reproducible builds #509

Closed
kylixs opened this issue Jul 17, 2020 · 1 comment
Milestone

Comments

@kylixs
Copy link

kylixs commented Jul 17, 2020

Describe your idea

following Maven's guide https://maven.apache.org/guides/mini/guide-reproducible-builds.html
After add a project.build.outputTimestamp property to the project's pom.xml with the timestamp value, the output should be reproducible.

But there is no way to use project.build.outputTimestamp as the initial value of git.build.time,
it is always initialized to the current time of the system:

  // git-commit-id-plugin-core : pl.project13.core.cibuild.BuildServerDataProvider
  private void loadBuildVersionAndTimeData(@Nonnull Properties properties) {
    Supplier<String> buildTimeSupplier = () -> {
      Date buildDate = new Date();
      SimpleDateFormat smf = new SimpleDateFormat(dateFormat);
      if (dateFormatTimeZone != null) {
        smf.setTimeZone(TimeZone.getTimeZone(dateFormatTimeZone));
      }
      return smf.format(buildDate);
    };
    maybePut(properties, GitCommitPropertyConstant.BUILD_TIME, buildTimeSupplier);

@kylixs kylixs changed the title Allow project.build.outputTimestamp as the value of git.build.time to support reproducible builds Allow initial git.build.time from project.build.outputTimestamp to support reproducible builds Jul 17, 2020
@TheSnoozer
Copy link
Collaborator

Thanks for creating an issue here. Good point. Sounds like the plugin should respect that property (if available)

@TheSnoozer TheSnoozer added this to the 4.0.2 milestone Jul 17, 2020
TheSnoozer pushed a commit to TheSnoozer/git-commit-id-maven-plugin that referenced this issue Aug 5, 2020
….outputTimestamp' to support reproducible builds
TheSnoozer added a commit that referenced this issue Aug 6, 2020
#509: Allow initial 'git.build.time' from 'project.build.outputTimestamp' to support reproducible builds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants