The file encoding can be set through the properties as shown in the following pom fragment.
<project> ... <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> ... </properties> ... </project>
It is highly recommended to set the files encoding. Note that if unset, the OS default encoding is used, which vary between different OSes. This may cause compilation problems when files are shared with different OSes especially when using any special characters, such as ö.