Conversation
Replace the deprecated boolean 'overwrite' parameter with a 'changeDetection' strategy enum (CONTENT / TIMESTAMP / TIMESTAMP_AND_CONTENT / ALWAYS / NEVER), forwarded from maven-filtering 4.0.0-beta-2-SNAPSHOT (PR apache/maven-filtering#397). - Add 'changeDetection' @parameter (default CONTENT, i.e. current behaviour) - Deprecate 'overwrite'; bridge: overwrite=true maps to ALWAYS, overwrite=false keeps the declared changeDetection value (backward-compat) - Add IT MRESOURCES-453: verifies that changeDetection=NEVER leaves an existing destination file untouched even when source content differs Fixes: #453 Depends on: apache/maven-filtering#397
gnodet-bot
left a comment
There was a problem hiding this comment.
Clean and well-structured change. The backward-compat bridge (overwrite=true → ALWAYS) is correct, the Javadoc is thorough, and the IT covers the NEVER edge case properly with setup/verify scripts.
One minor documentation nit below.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
| * <li>{@code NEVER} — never overwrite an existing destination file.</li> | ||
| * </ul> | ||
| * | ||
| * @since 3.4.0 |
There was a problem hiding this comment.
💡 @since 3.4.0 is wrong — this parameter is introduced in this PR, and the project version is 4.0.0-beta-2-SNAPSHOT. The @since should reflect the actual release version.
| * @since 3.4.0 | |
| * @since 4.0.0-beta-2 |
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after new commit 476787e (CI: enable Apache Snapshots repo for SNAPSHOT dependency). The CI change is correct — needed for the maven-filtering 4.0.0-beta-2-SNAPSHOT dependency.
However, the @since finding from the previous review is still unaddressed.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
| * <li>{@code NEVER} — never overwrite an existing destination file.</li> | ||
| * </ul> | ||
| * | ||
| * @since 3.4.0 |
There was a problem hiding this comment.
@since 3.4.0 is incorrect — this parameter is introduced in this PR. The project version is 4.0.0-beta-2-SNAPSHOT, so this should be @since 4.0.0-beta-2.
| * @since 3.4.0 | |
| * @since 4.0.0-beta-2 |
|
CI failure: The prerequisite PR apache/maven-filtering#397 (which introduces the This PR cannot compile until maven-filtering#397 is merged and a new SNAPSHOT is deployed. |
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after commit 476787e (CI: add -Dapache.snapshots for SNAPSHOT dependency). CI change is correct and necessary.
The @since finding from both previous reviews remains unaddressed.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
| * <li>{@code NEVER} — never overwrite an existing destination file.</li> | ||
| * </ul> | ||
| * | ||
| * @since 3.4.0 |
There was a problem hiding this comment.
@since 3.4.0 is incorrect — the changeDetection parameter is introduced in this PR. The milestone is 4.0.0-beta-2.
| * @since 3.4.0 | |
| * @since 4.0.0-beta-2 |
|
CI failure on This is expected — this PR depends on apache/maven-filtering#397 being merged and deployed as a SNAPSHOT first. That PR is open with CI green, awaiting review/merge. Once maven-filtering#397 is merged and the SNAPSHOT is published, CI here will pass. |
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after commit 83ca419 — the @since tag is now correctly set to 4.0.0-beta-2. Previous finding addressed.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
|
The compilation fails because Once maven-filtering#397 is merged and the snapshot is deployed, this PR's CI should pass. — Hermès 🤖 |
Summary
Port of the
ChangeDetectionstrategy from apache/maven-filtering#397 into the plugin.Instead of a binary
overwriteboolean, expose the newchangeDetectionenum parameter so users have explicit control over the copy semantics:CONTENTCachingOutputStreamTIMESTAMPTIMESTAMP_AND_CONTENTALWAYS<overwrite>true</overwrite>)NEVERChanges
pom.xml: bumpmavenFilteringVersionto4.0.0-beta-2-SNAPSHOT(requires feat: introduce ChangeDetection strategy for file copy maven-filtering#397 to be merged and released first)ResourcesMojo: addchangeDetection@Parameter(defaultCONTENT); deprecateoverwritewith backward-compat bridge (overwrite=true→ALWAYS;overwrite=falsedefers to the declaredchangeDetection)MRESOURCES-453: verifieschangeDetection=NEVERleaves an existing destination file untouched even when source content differsFixes
overwrite=falsein 3.4.0)TIMESTAMPstrategy restores pre-3.4.0 semantics)The root cause is in maven-filtering (the
overwriteparameter was silently dropped when the NIO/CachingOutputStreammigration landed). This PR is the plugin-side companion to apache/maven-filtering#397.Related
mavenFilteringVersionto the released4.0.0-beta-2.changeDetection, separate feature — supported viaResource.changeDetectionin maven-filtering#397)