gnodet opened a new issue, #521:
URL: https://github.com/apache/maven-resources-plugin/issues/521

   ## Problem
   
   `maven-resources-plugin` exposes `<nonFilteredFileExtensions>` for bypassing 
text filtering on binary files, but this is insufficient for projects that:
   - Have extension-less binary files (test keystores, generated fixtures)
   - Want path-based exclusions (e.g. all files under 
`src/main/resources/certs/`)
   - Want to be surgical per `<resource>` block rather than globally
   
   See apache/maven-resources-plugin#303 for a concrete user report.
   
   ## Proposed Solution
   
   Once `maven-filtering` adds `List<String> nonFilteredFiles` to `Resource` 
(companion issue), expose it in `ResourcesMojo` and `TestResourcesMojo` as:
   
   ### Per-resource config (primary — per `<resource>` block)
   
   ```xml
   <resource>
     <directory>src/main/resources</directory>
     <filtering>true</filtering>
     <nonFilteredFiles>
       <nonFilteredFile>**/*.p12</nonFilteredFile>
       <nonFilteredFile>**/*.jks</nonFilteredFile>
       <nonFilteredFile>**/certs/**</nonFilteredFile>
       <nonFilteredFile>binary-file</nonFilteredFile>
     </nonFilteredFiles>
   </resource>
   ```
   
   ### Global opt-in graceful binary fallback (safety net)
   
   Add a `<gracefulBinaryHandling>` boolean parameter (default `false`) at the 
Mojo level, propagated to 
`MavenResourcesExecution.setGracefulBinaryHandling(true)`. When enabled, files 
that cause `MalformedInputException` during filtering are copied as-is with a 
`WARN` log rather than crashing the build.
   
   ```xml
   <configuration>
     <gracefulBinaryHandling>true</gracefulBinaryHandling>
   </configuration>
   ```
   
   ## See also
   
   - Companion issue in maven-filtering to add the underlying 
`Resource.nonFilteredFiles` field and the graceful fallback flag
   - apache/maven-resources-plugin#303 — original PR (to be superseded by this 
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