elharo opened a new pull request, #282:
URL: https://github.com/apache/maven-remote-resources-plugin/pull/282

   Fixes https://github.com/apache/maven-remote-resources-plugin/issues/267
   
   ### Problem
   
   When `useProjectFiles` is enabled, a resource override placed in the project
   root is copied verbatim via `FilteringUtils.copyFile`, bypassing Velocity
   processing. Unlike `copyResourceIfExists`, `copyProjectRootIfExists` also 
only
   looked for `<name>`, never for the `<name>.vm` template variant, so `.vm`
   overrides were silently ignored and the bundle template was used instead.
   
   ### Changes
   
   - `copyProjectRootIfExists` now mirrors `copyResourceIfExists`:
     - checks for both `<name>` and `<name>.vm` in the project root
     - renders `<name>.vm` through Velocity (`velocity.evaluate`) with the 
bundle's
       source encoding, matching the behavior of bundle-resource templates
     - plain files are still copied verbatim
   
   ### Tests
   
   - New test `testUseProjectFilesRendersVelocityTemplate`: writes a local
     `<basedir>/FILTER.txt.vm` containing `$project.name`, sets 
`useProjectFiles`
     and asserts the output `FILTER.txt` contains the rendered project name.
   - Verified the test fails without the fix and passes with it; full `mvn 
verify`
     (incl. spotless/checkstyle/RAT) passes.


-- 
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