gnodet opened a new pull request, #527:
URL: https://github.com/apache/maven-resources-plugin/pull/527

   ## Summary
   
   Port of the `ChangeDetection` strategy from 
[apache/maven-filtering#397](https://github.com/apache/maven-filtering/pull/397)
 into the plugin.
   
   Instead of a binary `overwrite` boolean, expose the new `changeDetection` 
enum parameter so users have explicit control over the copy semantics:
   
   | Value | Behaviour |
   |---|---|
   | `CONTENT` | *(default)* Only overwrite when content differs — i.e. current 
post-3.4.0 behaviour via `CachingOutputStream` |
   | `TIMESTAMP` | Only overwrite when source is newer than destination — i.e. 
pre-3.4.0 behaviour |
   | `TIMESTAMP_AND_CONTENT` | Combine both checks |
   | `ALWAYS` | Always overwrite (replaces `<overwrite>true</overwrite>`) |
   | `NEVER` | Never overwrite an existing destination file |
   
   ## Changes
   
   - `pom.xml`: bump `mavenFilteringVersion` to `4.0.0-beta-2-SNAPSHOT` 
(requires 
[apache/maven-filtering#397](https://github.com/apache/maven-filtering/pull/397)
 to be merged and released first)
   - `ResourcesMojo`: add `changeDetection` `@Parameter` (default `CONTENT`); 
deprecate `overwrite` with backward-compat bridge (`overwrite=true` → `ALWAYS`; 
`overwrite=false` defers to the declared `changeDetection`)
   - New IT `MRESOURCES-453`: verifies `changeDetection=NEVER` leaves an 
existing destination file untouched even when source content differs
   
   ## Fixes
   
   - https://github.com/apache/maven-resources-plugin/issues/453 (destination 
overwritten even with `overwrite=false` in 3.4.0)
   
   The root cause is in maven-filtering (the `overwrite` parameter was silently 
dropped when the NIO/`CachingOutputStream` migration landed). This PR is the 
plugin-side companion to 
[apache/maven-filtering#397](https://github.com/apache/maven-filtering/pull/397).
   
   ## Related
   
   - https://github.com/apache/maven-resources-plugin/issues/354 (TIMESTAMP 
strategy restores pre-3.4.0 semantics)
   - https://github.com/apache/maven-resources-plugin/issues/316 
(log-before-decision, separate issue)
   - https://github.com/apache/maven-resources-plugin/issues/286 (per-resource 
overwrite, separate feature)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to