[
https://issues.apache.org/jira/browse/MRESOURCES-281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17486265#comment-17486265
]
Carsten Rohde commented on MRESOURCES-281:
------------------------------------------
I just scanned my projects for further cases where this issue matters and I
think there is another (more common, I think) case for this feature-request:
I've got a project where we use cp1252 as the global resource encoding since
many of the resources are windows-targeted. There are however resources that,
by convention, require a specific encoding such as xml (as indicated by the
encoding declaration), json (where utf-8 is the de facto standard) or yaml
(which requires utf-8, utf-16 or utf-32 afaik).
With the latter formats gaining in numbers, there is no real standard encoding
for resources in this project anymore. Using copy-resources with custom
resource-direcotries is not a very convenient solution as these directories
don't show up as resources in your ide and artificially having separate modules
sounds even worse to me.
What do you think: Does this make this issue any more likely to gain traction?
> allow different encodings for files inside the same resource-directory
> ----------------------------------------------------------------------
>
> Key: MRESOURCES-281
> URL: https://issues.apache.org/jira/browse/MRESOURCES-281
> Project: Maven Resources Plugin
> Issue Type: Improvement
> Components: filtering
> Affects Versions: 3.2.0
> Reporter: Carsten Rohde
> Priority: Major
> Labels: encoding, feature, newbie
>
> Currently each resource-directory has a single encoding, with the recent
> exception of properties (MRESOURCES-171).
> If you need to filter differently encoded files, this can become quite a
> hazzle: The only way (at least that I'm aware of) is to have different
> resouce-directories, one for each encoding. Apart from bloating the pom, it
> also forces you to have related files at different locations if they are
> encoded differently.
>
> What I'm suggesting is to generalize what has been done for properties by
> allowing to override the <encoding> for specific files/patterns.
> Ideally this would be part of the resource-declaration but being able to
> configure the resources plugin accordingly would already help a lot:
> {code:java}
> <configuration>
> <encodingOverrides>
> <encodingOverride>
> <encoding>UTF-16</encoding>
> <includes>**/*.myfile</includes>
> </encodingOverride>
> <encodingOverride>
> <encoding>iso-latin-1</encoding>
> <includes>**/*.other</includes>
> </encodingOverride>
> </encodingOverrides>
> </configuration>
> What do you think?{code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)