Skip to content

Use a ZIP-compatible default project build output timestamp - #8509

Merged
timtebeek merged 4 commits into
openrewrite:mainfrom
martinfrancois:agent/repro-output-timestamp-zip-minimum
Aug 17, 2026
Merged

Use a ZIP-compatible default project build output timestamp#8509
timtebeek merged 4 commits into
openrewrite:mainfrom
martinfrancois:agent/repro-output-timestamp-zip-minimum

Conversation

@martinfrancois

@martinfrancois martinfrancois commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Suggested review order: 12 of 52 (Score: 7.5)
Review first: openrewrite/rewrite-static-analysis#1007

What's changed?

Changes the default project build output timestamp from 1980-01-01T00:00:00Z to the earliest ZIP-compatible value, 1980-01-01T00:00:02Z, and updates the generated recipe metadata and examples.

What's your motivation?

Recipe: org.openrewrite.maven.cleanup.AddProjectBuildOutputTimestamp.

I found this by running org.openrewrite.maven.cleanup.AddProjectBuildOutputTimestamp from org.openrewrite:rewrite-maven:8.87.0 on pom.xml in Symphony-Trello at a8013f27. I reproduced the same result with the latest released recipe artifact, org.openrewrite:rewrite-maven:8.90.0, using org.openrewrite.maven:rewrite-maven-plugin:6.46.1. Running maven-pmd-plugin:3.28.0:pmd on the transformed checkout fails with: '1980-01-01T00:00:00Z' is not within the valid range 1980-01-01T00:00:02Z to 2099-12-31T23:59:59Z.

Before

<properties>
  <java.version>25</java.version>
</properties>

Actual after the recipe

<properties>
  <java.version>25</java.version>
  <project.build.outputTimestamp>1980-01-01T00:00:00Z</project.build.outputTimestamp>
</properties>

Expected after the recipe

<properties>
  <java.version>25</java.version>
  <project.build.outputTimestamp>1980-01-01T00:00:02Z</project.build.outputTimestamp>
</properties>

ZIP timestamps have a two-second resolution and reject the emitted value. The recipe therefore adds a property that makes a normal Maven reporting goal fail.

Confirmed real-world execution

Anything in particular you'd like reviewers to focus on?

Please review the two-second lower bound and the synchronized updates to the generated example and recipe metadata.

Have you considered any alternatives or workarounds?

Projects can override the generated timestamp manually. The recipe should nevertheless emit a default accepted by ZIP-producing Maven plugins.

Any additional context

Pre-existing tests changed: ReproducibleBuildsTest.java.appliesEncodingAndOutputTimestamp (updated), AddProjectBuildOutputTimestampTest.java.addsDefaultTimestamp (updated), AddProjectBuildOutputTimestampTest.java.addsToExistingPropertiesBlock (updated).

  • Target commit: martinfrancois/symphony-trello@a8013f27
  • Discovery release: org.openrewrite:rewrite-maven:8.87.0
  • Latest verification release: org.openrewrite:rewrite-maven:8.90.0
  • Focused tests: AddProjectBuildOutputTimestampTest

This change was prepared with AI assistance. I reviewed the target execution evidence, implementation, tests, generated metadata, and contribution text.

Checklist

@martinfrancois martinfrancois changed the title Use a ZIP-valid default project build output timestamp Use a ZIP-compatible default project build output timestamp Aug 15, 2026
@martinfrancois
martinfrancois force-pushed the agent/repro-output-timestamp-zip-minimum branch from caef079 to f93b60c Compare August 15, 2026 21:58
@martinfrancois
martinfrancois marked this pull request as ready for review August 17, 2026 08:08
It asserted exactly the same thing as the @DocumentExample above it.
@timtebeek
timtebeek merged commit ad4a7ca into openrewrite:main Aug 17, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants