Maven 3 source encoding

Published: Sunday, 15 December 2013

Warning: Using platform encoding

If you do not specify the file encoding in your build, then you will see warnings as part of your build:

Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!

To fix this, specify the encoding (and make sure your files are correctly encoded) in your pom.xml

<project>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
</project>