Recently I updated Maven to newest release (2.1.0) for a new project. Upgrade from 2.0.9 was smooth and all existing build scripts were working fine. While glancing at the logs emitted by Maven found this warning message-
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
This warning message was not emitted by Maven 2.0.9. Reason of this warning message is that maven (plugins) use platform default encoding and it notifies the users about the build being platform dependent. This article (http://docs.codehaus.org/display/MAVENUSER/POM+Element+for+Source+File+Encoding) has detailed information about this change. Instead of using platform default encoding, Maven can be instructed to use any encoding by adding following property in the pom.xml
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
and it no longer emits the warning message.
Wednesday, April 22, 2009
Encoding warning with Maven 2.1.0
Subscribe to:
Post Comments (Atom)
12 Comments:
Ditto. Thanks a lot.
Thanks, ran into the same issue.
Thanks a ton for posting this!
Thanks for the post, big help.
11 PM Just what I was looking for, thanks.
Also, thanks. Was a good help.
Thanks a lot. Resolved my confusion after maven upgrade.
Alternatively, use this to keep maven's default behaviour, i.e. to use the platform's default encoding. This is what Eclipse (and many other editors) by default does, so this might not be a bad idea:
<properties>
<project.build.sourceEncoding>${file.encoding}</project.build.sourceEncoding>
</properties>
This is covered in the Maven docos here:
http://maven.apache.org/general.html#encoding-warning
Hey, Thanks a lot!
Really thank you for this hint! *thumps up*
Thank you, this tamed the ERROR/WARNING output of MAVEN's verbosity. MAVEN is finally silent now. Even remains silent, when removing the -Tag.
Post a Comment