Maven2 site encoding problems
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
maven-site-plugin
2.0-SNAPSHOT
en
utf-8
utf-8
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.

4 Comments
tomorrow - 2008/04/20
Hi, have you solved the problem with menu items translation of maven reports ?
admin - 2008/04/21
I’m sorry I haven’t yet. But in the next weeks I will do quite a lot of Maven2 stuff and I will look into that! so far I can say that since initially writing my post I have done several upgrades of Maven2 (now 2.0.9) and none of these has changed regarding this. My first try willl be to unpack the propert reporting plugin, re-encode the localized properties files pack them up again and then see if it helps!
anonymous - 2009/11/21
This did not work for me, but I figured it out by now.
As this is fairly high up at Google if you search for “maven site utf-8″, I’d like to add it to the comments here.
You have to add this property (perhaps along with your settings) and it will work with current Maven-versions:
<project> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> </project>See also http://docs.codehaus.org/display/MAVENUSER/POM+Element+for+Source+File+Encoding
Martin Ahrer - 2009/12/07
Another hint regarding that – http://www.redleopard.com/2009/04/macroman-encoding-creeps-into-maven/