[ https://issues.apache.org/jira/browse/MRESOURCES-281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17541864#comment-17541864 ]
Carsten Rohde commented on MRESOURCES-281: ------------------------------------------ Just in case anyone else has the same problem. We finally ended up with the following: * create a folder e.g. src/main/filtered-resources-<encoding> * use resources:copy-resources with the required encoding encoding to copy into the output directory * (Eclipse) use build-helper:add-resource or a resource element to add the folder as a project resource folder and then exclude everything inside, thus tricking eclipse into rendering the folder as a first-clas resource-folder * (Eclipse) ensure that resources:copy-resources is bound by m2e > 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 > modules or non-resource directories as the source for copy-resources. 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.7#820007)