gnodet opened a new pull request, #407: URL: https://github.com/apache/maven-filtering/pull/407
## Summary Adds the ability to configure a separate output encoding when filtering resources, enabling **encoding conversion** during the build (e.g. reading ISO-8859-1 / EBCDIC sources and writing UTF-8 output, or vice-versa). Closes https://github.com/apache/maven-resources-plugin/issues/335 ## Changes ### `FilteringUtils` - `copyFile()` refactored: the existing single-encoding overload now delegates to a new overload that accepts separate `inputEncoding` / `outputEncoding` parameters. The no-filter path (raw byte copy) is unchanged — encoding is irrelevant there. ### `MavenFileFilter` interface - New default `copyFile(from, to, filtering, wrappers, inputEncoding, outputEncoding, gracefulBinaryHandling)` overload. The existing `gracefulBinaryHandling` overload now delegates to it. ### `DefaultMavenFileFilter` - Overrides the new overload, using separate charsets for the `Reader` and `CachingWriter`. ### `MavenResourcesExecution` - New fields: `outputEncoding` and `outputPropertiesEncoding` with getters/setters. - `copyOf()` propagates them. ### `Resource` - New fields: `encoding` and `outputEncoding` (per-resource overrides), following the same pattern as other per-resource fields. ### `DefaultMavenResourcesFiltering` - Per-file loop now computes separate `inputEncoding` / `outputEncoding`, respecting per-resource overrides first, then global values, then falling back to symmetric behaviour (same encoding for read and write). - New `getOutputEncoding(file, outputEncoding, outputPropertiesEncoding, inputEncoding)` static helper, mirrors `getEncoding()`. ## Tests - `getOutputEncoding()`: unit-tests all fallback combinations - `filterResourcesWithOutputEncoding()`: end-to-end ISO-8859-1 → UTF-8 conversion with token expansion - `filterResourcesWithPerResourceOutputEncoding()`: per-resource override ## Companion PR A companion PR for `maven-resources-plugin` will follow, adding `<outputEncoding>` as a Mojo parameter. -- 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]
