Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: POM v5 proposal for Maven 4

...

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 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.

...