I would like to retrieve maven build number in pom.xml so that I could use it to tag docker image with dockerfile-maven-plugin. I have checked out https://www.mojohaus.org/buildnumber-maven-plugin/usage.html but that's not what I want. According to https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm#MAVEN8855 how do I get the build information to be used in my pom.xml? Is it possible? Thanks!
Asked
Active
Viewed 216 times
0
-
If it is not the build number from the plugin that you mention, then what build number are you refering to? A Jenkins build number? – Andreas Lorenzen Mar 19 '19 at 07:08
-
Maven build number, as in `maven clean install`. Does it generate a new build number every time it is run? – Kok How Teh Mar 19 '19 at 07:29
-
It does not, you need to use the plugin `buildnumber-maven-plugin` to have this behaviour – Andreas Lorenzen Mar 19 '19 at 07:51
-
Could you show me which build number you mean, i.e. an example? – J Fabian Meier Mar 19 '19 at 07:52
-
but buildnumber-maven-plugin needs SCM configuration which I don't need. I just build from my localhost, push the source code to github, build the image and push the image to dockerhub. – Kok How Teh Mar 19 '19 at 07:54
-
@JFMeier, https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm#MAVEN8855 – Kok How Teh Mar 19 '19 at 07:54
-
So you mean a build number as part of the version number? Where is the build number defined? In your POM? Or is it supplied? – J Fabian Meier Mar 19 '19 at 08:51
-
I expect every maven build would have a number and that's what I am going to use. – Kok How Teh Mar 19 '19 at 12:08