phauer/blog-related

versioning-continuous-delivery doesn't work with Maven 3.5.0

edysli opened this issue · 0 comments

Hi Philipp,
I read your article about version numbers and tried your example project, but it does not work with Maven 3.5.0. Running mvn package on versioning-continuous-delivery gives me the following warning message and the version is not correctly computed.

[WARNING] 
[WARNING] Some problems were encountered while building the effective model for de.philipphauer.blog:versioning-continuous-delivery:jar:${git.commit.time}.${git.commit.id.abbrev}
[WARNING] 'version' contains an expression but should be a constant. @ de.philipphauer.blog:versioning-continuous-delivery:${version.number}, blog-related/versioning-continuous-delivery/pom.xml, line 8, column 11
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building versioning-continuous-delivery ${git.commit.time}.${git.commit.id.abbrev}
[INFO] ------------------------------------------------------------------------

Maven only allows certain specific properties to be used in defining project.version and these cannot be derived from other properties.