...
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):
< 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, 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.
...