The main pom
file receives the version value as a maven command-line argument.
What I want to achieve is to prevent the build from executing if the argument is either non-existing in the command (not passed), or if it has empty string value, something like -DbuildVersion=
or -DbuildVersion=""
.
The reason is that the generated JARs should not end up without the version number, or worse - with the dummy value set in the buildVersion
property.
================= Solution: For anyone having the similar need - use Maven Enforcer Plugin. http://maven.apache.org/enforcer/enforcer-rules/requireProperty.html