How to get Maven to automatically use git status as part of version number?

Viewed 978

This question is a narrower version of the broader Automatically incrementing a build number in a Java project

Specifically I want Maven to generate versions of the format major.minor.sequence where major.minor are hard-coded in the pom.xml but the sequence number is obtained from the output of the command git rev-list HEAD --count. I also want to append the string "-WIP" if the git status does not contain the words nothing to commit, working tree clean.

What is the easiest way to accomplish this?

2 Answers
Related