Provide specific default value for "encoding" parameter
-------------------------------------------------------
Key: MCOMPILER-63
URL: http://jira.codehaus.org/browse/MCOMPILER-63
Project: Maven 2.x Compiler Plugin
Issue Type: Improvement
Affects Versions: 2.0.2
Reporter: Benjamin Bentmann
Priority: Minor
Attachments: source-encoding.patch
As stated in the [javac
doc|http://java.sun.com/javase/6/docs/technotes/tools/windows/javac.html#standard],
the parameter "encoding" defaults to the platform's default encoding if not
specified. This might be a convenient feature when running javac directly from
the console prompt (less typing) but I consider this harmful for an automated
build. The platform's default encoding might easily differ between
machines/developers, causing unreliable build output.
Maven has "reproducible builds" on its banner and as such, locking down all
plugin versions has recently become a best practice. Likewise, the encoding
used to process source files should be locked down. As Maven furthermore
prefers convention over configuration, such a lockdown should be provided
out-of-the-box.
The attached patch adds a default value for the encoding that locks the
encoding down to "ISO-8859-1" if not explicitly overriden by the user in the
POM. I chose Latin-1 for consistency with the behavior of the Maven Site Plugin
although I personally would have preferred UTF-8.
Releasing the patch might break existing builds where users have relied on
their platform's default encoding for handling Non-ASCII sources. The group of
those people is hopefully small and their build can be easily fixed by updating
the POM.
Not emulatable would be the possibility to explicitly use the platform's
default encoding as now but I do not think that there is really somebody out
there playing russian roulette with the build output... Besides, now one
requested such a risky thing for the Maven Site Plugin.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira