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

   ## Summary
   
   Adds a new `outputEncoding` plugin parameter that configures the character 
encoding used to **write** filtered resources. When set, the plugin reads 
source files with `encoding` and writes filtered output with `outputEncoding`, 
enabling lossless encoding conversion during the build.
   
   Closes https://github.com/apache/maven-resources-plugin/issues/335
   
   Companion filtering PR: https://github.com/apache/maven-filtering/pull/407
   
   ## Use case
   
   Converting a legacy EBCDIC or Latin-1 (ISO-8859-1) source tree to UTF-8 
output without manually converting the source files:
   
   ```xml
   <plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-resources-plugin</artifactId>
     <configuration>
       <encoding>ISO-8859-1</encoding>
       <outputEncoding>UTF-8</outputEncoding>
     </configuration>
   </plugin>
   ```
   
   Or as a CLI property: `-Dmaven.resources.outputEncoding=UTF-8`
   
   Per-resource encoding override via `<encoding>` / `<outputEncoding>` inside 
a `<resource>` block is also supported (requires the companion filtering PR to 
be released first).
   
   ## Notes
   - The parameter only applies to **filtered** resources 
(`<filtering>true</filtering>`). Non-filtered files are always copied as raw 
bytes — encoding is irrelevant for them.
   - When `outputEncoding` is not set (the default), the same encoding is used 
for reading and writing, preserving full backward compatibility.
   - `pom.xml` references `maven-filtering 4.0.0-beta-2-SNAPSHOT` for local 
build; will be updated to the released version once the companion PR is merged 
and released.
   
   ## Changes
   - `ResourcesMojo`: new `@Parameter outputEncoding` field wired into 
`MavenResourcesExecution.setOutputEncoding()`
   - `src/it/MRESOURCES-232/`: IT with a Latin-1 source file containing a 
filter token and an é character; verifies the output file is UTF-8-encoded with 
the token expanded and é surviving as `0xC3 0xA9`


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