Friday, October 16, 2009

Die MacRoman, DIE!!

OSX defaults to MacRoman for an encoding, so if you're using Maven, you might see messages like:
[WARNING] Using platform encoding (MacRoman actually) to copy
filtered resources, i.e. build is platform dependent
Simple enough, but it can cause you headaches. To change to UTF-8, just add the following properties to your pom.xml:
<properties>
...
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
...
</properties>


(edit: had a couple typos, encoding in the property name needs to start with a capital E - camelCase)

No comments: