I have always had problems with Maven2 and localized project web sites resulting in incorrect display of special characters (like german umlaut etc.). There are many posts regarding this with none really providing solutions.

Today I did a retry and set up a project site driven by apt documents and a site.xml containing special characters. Here is what I think made it working:

  • Set the IDE encoding to UTF-8
  • All site documents (including site.xml) are UTF-8 encoded.
  • Configure the maven-site-plugin to accept and produce UTF-8
  • Set the system property file.encoding (e.g. set MAVEN_OPTS=-Dfile.encoding=UTF-8) before calling the mvn command
1
2
3
4
5
6
7
8
9
<plugin>
  <artifactid>maven-site-plugin</artifactid>
  <version>2.0-SNAPSHOT</version>
  <configuration>
    <locales>en</locales>
    <inputencoding>utf-8</inputencoding>
    <outputencoding>utf-8</outputencoding>
  </configuration>
</plugin>

Still I’m struggling with the translations of the menu items provided by the maven-site-plugin which are still not ok! But I’m confident to solve this soon.

Comments