[
https://issues.apache.org/jira/browse/MRESOURCES-171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17159155#comment-17159155
]
Dennis Lundberg edited comment on MRESOURCES-171 at 7/16/20, 12:01 PM:
-----------------------------------------------------------------------
I'm trying to work out how to warn the users properly, if they have not set the
new parameter for properties file encoding. The
DefaultMavenResourcesFiltering#filterResources() in maven-filtering currently
handles warning users if they have not set the regular encoding parameter. So I
would like to add the new warning there as well. That way all plugins will
benefit from this, wihtout having to write any code for it.
Locally I tried to add the warning in a similar way as for regular encoding.
That however gets very noisy, since all the builds in the world would get this
warning, if they just update to the new plugin. So I'm trying to make a fail
fast, and not too time consuming, educated guess as to whether a project
warrants a warning or not. Here's what I've thought of so far. Show a warning
to the user if *all* of the following are true:
# .properties is a filtered extension, taking into account any configured
nonFilteredFileExtensions
# resource.isFiltering() is true for any of the resources
# there is at least one properties file among all the files in all the resources
Thoughs and comments are most welcome!
was (Author: dennisl):
I'm trying to work out how to warn the users properly, if they have not set the
new parameter for properties file encoding. The in
DefaultMavenResourcesFiltering#filterResources() in maven-filtering currently
handles warning users if they have not set the regular encoding parameter. So I
would like to add the new warning there as well. That way all plugins will
benefit from this, wihtout having to write any code for it.
Locally I tried to add the warning in a similar way as for regular encoding.
That however gets very noisy, since all the builds in the world would get this
warning, if they just update to the new plugin. So I'm trying to make a fail
fast, and not too time consuming, educated guess as to whether a project
warrants a warning or not. Here's what I've thought of so far. Show a warning
to the user if *all* of the following are true:
# .properties is a filtered extension, taking into account any configured
nonFilteredFileExtensions
# resource.isFiltering() is true for any of the resources
# there is at least one properties file among all the files in all the resources
Thoughs and comments are most welcome!
> ISO8859-1 properties files get changed into UTF-8 when filtered
> ---------------------------------------------------------------
>
> Key: MRESOURCES-171
> URL: https://issues.apache.org/jira/browse/MRESOURCES-171
> Project: Maven Resources Plugin
> Issue Type: Bug
> Components: filtering
> Reporter: Alex Collins
> Priority: Minor
> Attachments: filtering-bug.zip
>
>
> Create:
> src/main/resources/test.properties
> And add a ISO8859-1 character that is not ASCII or UTF-8, do not use \uXXXX
> formatting.
> When adding this line:
> <resource><directory>src/main/resources</directory><filtering>true</filtering></resource>
> Expected:
> ISO8859-1 encoded file in jar.
> Actual:
> UTF-8 encoded file in jar.
> ---
> If there are any property files (which can only be ISO8859-1) they appear to
> be converted into UTF-8 in the jar.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)