maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernd Eckenfels <>
Subject Re: Special <version> parameters - sha1
Date Tue, 14 Nov 2017 02:21:07 GMT
You can use the 3 Properties in any way you want it, their name suggest a certain content,
and it was deemed necessary to restrict the expansion to a fixed set. so the 3 have been picked
to give some guidance on what are sane modifiers.

You will most likely use revision for the Version and changelist or sha for the incremental
builds, but you can also cram everything into revision, Maven does not really care how you
use them (as long as you use nothing else)

From: Eric B <>
Sent: Tuesday, November 14, 2017 3:12:21 AM
To: Maven Users List
Subject: Special <version> parameters - sha1

Following a long thread on this list, and a blog by khmarbaise (,
I'm still a little confused as to exactly what is allowed in the special
version tags for a maven pom.

I know and realize that the 3 allowable tags are:
 - ${revision}
 - ${sha1}
 - ${changelist}

However, from the thread and the blog, it seems that these properties
cannot be dependent on any other properties.

For example, this is fine:
where mvn is called with -Drevision=1.2.3 -Dsha1=1a2b3c4e

However, based on the further docs at, this design would fail:



and call it as -Drevision=1.2.3 -DbuildNumber=99999

Is anyone able to shed some light as to why this would be the case?  Why
can a property not be used to compute on of the 3 special vars?

My use case is that I want to supply the build number to all my builds, but
only append it to the version if a specific profile is enabled.  In my
mind, it would be simple - make the sha1 property empty by default, and in
my specific profile, set it to the buildnumber.   But based on my
understanding, this would fail.

Is my only option in that case to design it as:



What is the reason for this limitation?  Is there any chance that this
limitation will be removed in the future?



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message