Skip to content

Add Maven recipes for reproducible builds#7541

Merged
timtebeek merged 3 commits intomainfrom
tim/maven-reproducible
May 1, 2026
Merged

Add Maven recipes for reproducible builds#7541
timtebeek merged 3 commits intomainfrom
tim/maven-reproducible

Conversation

@timtebeek
Copy link
Copy Markdown
Member

@timtebeek timtebeek commented May 1, 2026

Summary

Adds a new org.openrewrite.maven.ReproducibleBuilds composite that configures a Maven project per the Maven Reproducible Builds guide: pins dependency and plugin versions (via existing ExplicitDependencyVersion / ExplicitPluginVersion), sets project.build.outputTimestamp (default 1980-01-01T00:00:00Z, configurable), adds explicit UTF-8 source and reporting encoding, and upgrades Apache Maven plugins to versions that honor the output timestamp.

Introduces three new declarative recipes — AddSourceEncodingProperty, UpgradePluginVersionsForReproducibleBuilds, ReproducibleBuilds — and one Java recipe, AddProjectBuildOutputTimestamp, which delegates to the existing AddProperty and preserves any pre-existing value.

Test plan

  • ./gradlew :rewrite-maven:test --tests "*AddProjectBuildOutputTimestampTest" --tests "*AddSourceEncodingPropertyTest" --tests "*ReproducibleBuildsTest" — 8 tests pass
  • ./gradlew :rewrite-maven:licenseFormat :rewrite-maven:assemble
  • CI green

Introduces a `ReproducibleBuilds` composite that sets
`project.build.outputTimestamp`, enforces UTF-8 source/reporting
encoding, and upgrades Apache Maven plugins to versions that honor the
output timestamp. Existing values are preserved.
timtebeek added 2 commits May 1, 2026 15:16
Removes the standalone AddSourceEncodingProperty and
UpgradePluginVersionsForReproducibleBuilds wrappers and inlines their
content directly in ReproducibleBuilds. ReproducibleBuildsTest still
exercises the full behavior end-to-end.
@timtebeek timtebeek merged commit 6154f2b into main May 1, 2026
1 check passed
@timtebeek timtebeek deleted the tim/maven-reproducible branch May 1, 2026 14:09
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite May 1, 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.

rewrite-maven: new recipes for reproducible builds

1 participant