Dear Developers,

a couple of plugins processes the contents of source files, e.g.
maven-resources-plugin, maven-compiler-plugin, maven-javadoc-plugin and
taglist-maven-plugin to name just a few. Unlike XML files, Java source files
have no intrinsic means of determining the required character encoding.
Therefore, the plugins must be manually configured with the correct
character encoding in order to properly convert the byte contents of the
source files into characters.

Currently, each plugin must be configured individually. That is, the POM
contains duplicated configuration settings. Surely, one could move the
encoding into a property and use this for the plugin configuration but this
does not feel say POM-like. The POM is not a silly Ant build file but a data
structure to describe a project, right? My project uses XYZ as source file
encoding. Wouldn't it be nice to state this once and not repeat it for every
plugin hanging around? One already states once where the source files are
located, so why not follow the same approach for their character encoding?

Therefore, I would like to request the introduction of another POM element
in Maven 2.1 or later to address the issue of source file encoding in a
central place. For example, Maven might add ${project.sourceEncoding} that
would be defaulted in the Super POM to say ISO-8859-1 or UTF-8.

Plugins can and should continue to provide their own configuration parameter
to specify the character encoding but their internals could be changed to
something like

 /*
  * @parameter expression="${project.sourceEncoding}"
  */
 private String encoding;

in order to start-off with the centrally provided POM setting.

Left to discussion is whether a single new POM element is sufficient or whether there should be individual encoding elements for the different kinds of source files, e.g. one for Java source files, one for resources, one for scripts etc.

Regards,


Benjamin Bentmann


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to