You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Florian Fray (JIRA)" <ji...@codehaus.org> on 2010/12/14 23:34:58 UTC

[jira] Commented: (MWAR-164) Support for specifying which encoding to use when filtering resources

    [ http://jira.codehaus.org/browse/MWAR-164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=247770#action_247770 ] 

Florian Fray commented on MWAR-164:
-----------------------------------

I was facing this problem in our builds as well, so I've worked around it by setting the JVM ??file.encoding??-property.
It works for me, but not for my team, so I'd like to fix it permanently.

For now my preference is to keep the existing behaviour as default (which is odd, but well known). In my patch I've added a property named ??resourceEncoding?? to the AbstractWarMojo.

I've added this to my parent-poms:

{code}
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-war-plugin</artifactId>
  <version>2.2-SNAPSHOT</version>
  <configuration>
    <resourceEncoding>${project.build.sourceEncoding}</resourceEncoding>
  </configuration>
</plugin>
{code}

In order to test this I've modified the ??web-resources-filtering??-Integration-Test and hope this will pass the review :-)

Please find my patch attached to this bug-report.


Best regards,

Florian

> Support for specifying which encoding to use when filtering resources
> ---------------------------------------------------------------------
>
>                 Key: MWAR-164
>                 URL: http://jira.codehaus.org/browse/MWAR-164
>             Project: Maven 2.x WAR Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.1-alpha-1
>            Reporter: kai lilleby
>             Fix For: 2.2
>
>
> Quoting Hervé:
> {quote}
> Maven filtering provides an encoding parameter to set encoding used when
> reading/writing files. But war plugin uses null value, which means platform
> encoding... Sorry, encoding support won't be totally "free" ;)
> I added TODOs in the code.
> For web.xml and container config XML file, I set encoding to UTF-8, which is a
> better default value than platform encoding.
> For other filtered resources, you'll need to add an encoding attribute to
> o.a.m.model.Resource class, to let the user define which encoding he wants to
> use when filtering. Perhaps using project.build.sourceEncoding as a default
> value is a good idea.
> Seems like this is worth a Jira issue to track this new feature.
> {quote}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira