I want to have the encoding of my project's file to be set to UTF-8.
Following maven FAQ answer, I set the project.build.sourceEncoding
property to UTF-8. unfortunatly, it has no effect.
Then, by looking at a m2eclipse JIRA, I tried a workaround by defining compiler plugin sourceEncoding
, but it neither worked, as I try to do that in a separate module parent pom.
Then, what is the solution to ensure my files are all in UTF-8 from maven ?
Thanks.
(A bit late) Solution / workaround I'm using to avoid inheriting MacRoman.
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalConfig>
<file>
<name>.settings/org.eclipse.core.resources.prefs</name>
<content>
<![CDATA[eclipse.preferences.version=1${line.separator}encoding/<project>=${project.build.sourceEncoding}${line.separator}]]>
</content>
</file>
</additionalConfig>
</configuration>
</plugin>
</plugins>
</build>
Execute the command below :
mvn eclipse:eclipse
Credits to Steven Cummings.