Repository navigation
fix(build): use release commit timestamps for Maven artifacts - #842
Merged
zhongkechen merged 2 commits intoOct 27, 2026
Merged
Conversation
zhongkechen
temporarily deployed
to
ai-pr-review-runtime
October 27, 2026 21:44 — with
GitHub Actions
Inactive
SilanHe
approved these changes
Oct 27, 2026
Contributor
Author
|
/ai review |
Contributor
Author
|
AI review workflow failed because this PR is from my fork. |
Contributor
Codex AI reviewOne approach finding at Reviewed commit |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue Link, if available
Related: #841 (closed) ultimately proposed a fixed timestamp in the parent POM, updated manually each release. This PR derives the timestamp automatically from the release commit and has no dependency on #841.
Description
Maven 3.10.0 enables reproducible builds by default and sets
project.build.outputTimestampto1980-02-01T00:00:00Zin its Super POM. The 2.3.0 release used Maven 3.10.0 fromubuntu-latest, so Maven Javadoc Plugin 3.12.0 derived the copyright year from that default and publishedCopyright © 1980.The release workflow now runs
set_release_timestamp.shbefore building. It writesMAVEN_ARGS=-Dproject.build.outputTimestamp=<release commit time>toGITHUB_ENV. Git's%ctsupplies a stable epoch timestamp from the checked-out release commit. The environment reaches both the initial build and each Maven subprocess inmaven_publish.sh. Javadoc continues to omit generation dates for reproducibility.Evidence: Maven 3.10.0 release notes, its Super POM, and the 2.3.0 release runner's software manifest.
Regression coverage design
The original local checks were not retained, so future changes could restore the 1980 fallback without a failing CI check. Share the timestamp setup script between the release workflow and committed Python
unittestcoverage, and run those tests in a dedicated read-only CI job on relevant PRs and main pushes.A unit test creates a real Git commit with different author and committer dates and checks the emitted environment. An integration test applies that environment to real Maven, using the SDK's actual Javadoc plugin configuration in a small Java fixture with the 1980 default. It verifies footer years, suppressed generation dates, archive timestamps, and identical JAR bytes across two time zones. The fixture's committer date is January 1, 2031 at UTC+14, which falls in UTC year 2030.
Decisions and alternatives:
MAVEN_ARGS(supported since Maven 3.9.0), avoiding repeated arguments in build/publish commands.Demo/Screenshots
Published Javadoc before:
Copyright © 1980. All rights reserved.After: the release commit's UTC year, e.g.
Copyright © 2026. All rights reserved.for a 2026 release commit.Checklist
Testing
Run both retained tests with Python 3, Git, Maven >=3.9, and JDK 17:
Unit Tests
test_uses_committer_timestamp_instead_of_author_or_wall_clockpasses. It checks the exact environment value against the fixture's independently specified committer date, which differs from its author date and the wall clock.Integration Tests
test_javadoc_uses_release_year_and_is_reproduciblepasses with real Maven 3.10.0 and Amazon Corretto 17. It verifies the fixture's UTC year 2030, no generation dates ordc.created, commit-derived ZIP timestamps, and byte-identical Javadoc JARs after clean builds inUTCandPacific/Kiritimati.Temporarily removing the timestamp override made this same retained test fail in both time zones: actual footer year
1980, expected2030. Restoring the script made both tests pass (about five seconds with cached Maven dependencies).Bash syntax, Python compilation, YAML parsing, and
git diff --checkpassed. CI runs the retained tests when the release workflow, timestamp setup, tests, test workflow, or parent POM changes.Unverified: the full GitHub release job, artifact signing, and Central upload were not run. SDK runtime tests were not rerun because the change supplies and tests Maven's release timestamp.
Examples
Not applicable; no SDK API or example changes.