...
Life would become easier if there was a dedicated POM element like ${project.build.sourceEncoding}
which could be used to specify the encoding once per entire project. Every plugin could use it as default value:
/** * @parameter expression="${encoding}" default-value="${project.build.sourceEncoding}" */ private String encoding; |
Adding this element to the POM structure can only happen in Maven 3.x 4+ (tracked with MNG-2216 issue and referenced in POM Model version 5.0.0 proposal):
...
< project > ... < build > <!-- NOTE: This is just a vision for the future, it's not yet implemented: see MNG-2216 --> < sourceEncoding >UTF-8</ sourceEncoding > ... </ build > ... </ project > |
For Maven 2 .x& 3, the value can be defined as an equivalent property:
...
< project > ... < properties > < project.build.sourceEncoding >UTF-8</ project.build.sourceEncoding > ... </ properties > ... </ project > |
Thus plugins could immediately be modified to use ${project.build.sourceEncoding
} expression, whatever Maven version is used.
...
- maven-changes-plugin (velocity template for announcement): MCHANGES-71, done in 2.1
- maven-checkstyle-plugin (source analysis): MCHECKSTYLE-95, done in 2.2
- maven-compiler-plugin (source processing): MCOMPILER-70, done in 2.1
- maven-invoker-plugin (beanshell script evaluation): MINVOKER-30, done in 1.2
- maven-javadoc-plugin (source processing): MJAVADOC-182, done in 2.5
- maven-jxr-plugin (source processing): JXR-60, done in 2.2
- maven-plugin-plugin (javadoc extraction, java source generation): MPLUGIN-101, MPLUGIN-100, done in 2.5
- maven-pmd-plugin (source analysis): MPMD-76, done in 2.4
- maven-resources-plugin (contents filtering): MRESOURCES-57, done in 2.3
- maven-site-plugin (apt sources): MSITE-314, done in 2.0-beta-7
Affected Codehaus plugins:
...
[1] http://www.nabble.com/Re%3A-Maven-and-File-Encoding-p16301958s177.html
[2] MNG-2216