Skip to content

Commit 1f348a5

Browse files
committed
Inline trivial wrapper recipes into ReproducibleBuilds composite
Removes the standalone AddSourceEncodingProperty and UpgradePluginVersionsForReproducibleBuilds wrappers and inlines their content directly in ReproducibleBuilds. ReproducibleBuildsTest still exercises the full behavior end-to-end.
1 parent ea781c6 commit 1f348a5

2 files changed

Lines changed: 11 additions & 137 deletions

File tree

rewrite-maven/src/main/resources/META-INF/rewrite/maven.yml

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,19 @@ recipeList:
160160
filePattern: "**/.mvn/wrapper/**"
161161
---
162162
type: specs.openrewrite.org/v1beta/recipe
163-
name: org.openrewrite.maven.cleanup.AddSourceEncodingProperty
164-
displayName: Add UTF-8 source and reporting encoding properties
163+
name: org.openrewrite.maven.ReproducibleBuilds
164+
displayName: Apache Maven reproducible builds
165165
description: >-
166-
Adds `project.build.sourceEncoding` and `project.reporting.outputEncoding` set to `UTF-8` when missing.
167-
An explicit encoding is required for reproducible builds and avoids platform-dependent compilation behavior.
166+
Configure a Maven project for [reproducible builds](https://maven.apache.org/guides/mini/guide-reproducible-builds.html):
167+
pin dependency and plugin versions, set `project.build.outputTimestamp`, set explicit UTF-8 source encoding,
168+
and upgrade core plugins to versions that honor the output timestamp.
168169
recipeList:
170+
- org.openrewrite.maven.cleanup.ExplicitDependencyVersion
171+
- org.openrewrite.maven.cleanup.ExplicitPluginVersion
172+
- org.openrewrite.maven.UpgradePluginVersion:
173+
groupId: org.apache.maven.plugins
174+
artifactId: "maven-*-plugin"
175+
newVersion: latest.release
169176
- org.openrewrite.maven.AddProperty:
170177
key: project.build.sourceEncoding
171178
value: UTF-8
@@ -174,30 +181,4 @@ recipeList:
174181
key: project.reporting.outputEncoding
175182
value: UTF-8
176183
preserveExistingValue: true
177-
---
178-
type: specs.openrewrite.org/v1beta/recipe
179-
name: org.openrewrite.maven.cleanup.UpgradePluginVersionsForReproducibleBuilds
180-
displayName: Upgrade Maven plugins to versions that honor `outputTimestamp`
181-
description: >-
182-
Upgrades core Maven plugins to the minimum version known to honor `project.build.outputTimestamp`,
183-
per the [Maven Reproducible Builds guide](https://maven.apache.org/guides/mini/guide-reproducible-builds.html).
184-
Plugins are only upgraded; older versions ignore `outputTimestamp` and produce non-reproducible artifacts.
185-
recipeList:
186-
- org.openrewrite.maven.UpgradePluginVersion:
187-
groupId: org.apache.maven.plugins
188-
artifactId: "maven-*-plugin"
189-
newVersion: latest.release
190-
---
191-
type: specs.openrewrite.org/v1beta/recipe
192-
name: org.openrewrite.maven.ReproducibleBuilds
193-
displayName: Apache Maven reproducible builds
194-
description: >-
195-
Configure a Maven project for [reproducible builds](https://maven.apache.org/guides/mini/guide-reproducible-builds.html):
196-
pin dependency and plugin versions, set `project.build.outputTimestamp`, set explicit UTF-8 source encoding,
197-
and upgrade core plugins to versions that honor the output timestamp.
198-
recipeList:
199-
- org.openrewrite.maven.cleanup.ExplicitDependencyVersion
200-
- org.openrewrite.maven.cleanup.ExplicitPluginVersion
201-
- org.openrewrite.maven.cleanup.UpgradePluginVersionsForReproducibleBuilds
202-
- org.openrewrite.maven.cleanup.AddSourceEncodingProperty
203184
- org.openrewrite.maven.cleanup.AddProjectBuildOutputTimestamp

rewrite-maven/src/test/java/org/openrewrite/maven/cleanup/AddSourceEncodingPropertyTest.java

Lines changed: 0 additions & 107 deletions
This file was deleted.

0 commit comments

Comments
 (0)