Questions tagged [buildnumber-maven-plugin]

This mojo is designed to get a unique build number for each time you build your project

Introduction

Official site : http://mojo.codehaus.org/buildnumber-maven-plugin/

This mojo is designed to get a unique build number for each time you build your project. So while your version may remain constant at 1.0-SNAPSHOT for many iterations until release, you will have a build number that can uniquely identify each build during that time. The build number is obtained from scm, and in particular, at this time, from svn. You can then place that build number in metadata, which can be accessed from your app, if desired.

The mojo also has a couple of extra functions to ensure you get the proper build number. First, your local repository is checked to make sure it is up to date. Second, your local repository is automatically updated, so that you get the latest build number. Both these functions can be suppressed, if desired.

Optionally, you can configure this mojo to produce a revision based on a timestamp, or on a sequence, without requiring any interaction with an SCM system. Note that currently, supported SCMs are : subversion, git and mercurial.

Goals Overview

buildnumber:create: Create a build number. buildnumber:create-timestamp: Create a timestamp. buildnumber:hgchangeset: Create properties for changeSet and changeSetDate from a Mercurial repository.

Usage

Instructions on how to use the Build Number Maven Plugin can be found on the usage page.

68 questions
2
votes
1 answer

change version number dynamically when build with maven

Instead of changing the version manually, is there any way to update it with the build number? 1.2.132-SNAPSHOT In the above code, I need the build number instead of 132. I've used the following code to generate the build…
coder247
  • 2,913
  • 19
  • 50
  • 70
2
votes
0 answers

create build number in git-svn environment

Development and test builds are build from a git svn clone repository while release build are build from a pure svn checkout. org.codehaus.mojo buildnumber-maven-plugin
oschrenk
  • 4,080
  • 4
  • 22
  • 25
2
votes
2 answers

Mercurial ChangeSet In OSGi Bundle MANIFEST with Maven

I am trying to get the Mercurial changeSet and changeSetDate set in my MANIFEST.MF file of OSGi bundle using Maven. I have added the buldnumber-maven-plugin into my pom.xml: org.codehaus.mojo
Paulius Matulionis
  • 23,085
  • 22
  • 103
  • 143
1
vote
1 answer

Java: Maven: get pom.xml information in properties file (mercurial hash as version)

Im facing the following problem: I want to integrate the mercurial hash into my java project. I want to integrate it in the name of the generate file (a debian package) and I also want to have a file like version.properties where I can access the…
nano7
  • 2,455
  • 7
  • 35
  • 52
1
vote
1 answer

Add a unique snapshot version upon copying resources with filtering

When copying resources with filtering in Maven, I want to add the unique snapshot version to a resource file. I have enabled filtering: ... My Application 0.1-SNAPSHOT ...
Stijn Van Bael
  • 4,830
  • 2
  • 32
  • 38
1
vote
1 answer

To generate a run ID during each run and reflect it in Maven Reports

I want to generate a run ID for each run in maven. For example if i run a test cases; a run id should be included in the report that can be used for identifying that test case run. Thanks in advance.
Amit Shakya
  • 1,396
  • 12
  • 27
1
vote
3 answers

turn off buildnumber-maven-plugin for submodules

Parent: org.codehaus.mojo buildnumber-maven-plugin 1.0
Alex
  • 967
  • 4
  • 15
  • 38
1
vote
2 answers

Buildnumber not getting propagated down to childern from parent

I am using the buildnumber-maven-plugin in my parent pom to create a build number. This works fine. However, I need to have the ${buildNumber} property in my child. I have added antrun ECHO for that property in my child and it is not there. How…
1
vote
0 answers

How the buildnumber-maven-plugin computes an incremental buildnumber?

I am working on a Maven project imported under Eclipse Neon which integrates M2Eclipse and therefore the version 3.3.9 of Maven. The sources of my project are managed under SVN 1.6 (yes I know it's old, but we cannot upgrade to 1.7 or 1.8). I wanted…
1
vote
0 answers

Include git-revision from dependencies

Short version: I want to store the latest revision-number (related to the individual module) from both current module AND its dependencies in the manifest of a jar. I have a multi-module Maven project. The modules are built into shaded jars (which…
Twelleby
  • 304
  • 1
  • 5
1
vote
1 answer

maven update version number automatically with buildNumber plugin

After watching some videos about setting up CI & CD and maven I tried to find the right order of how to use maven plugins in the release process. I set up a CI & CD chain before but it was with gradle, so the part that is the most confusing to me is…
Xtroce
  • 1,749
  • 3
  • 19
  • 43
1
vote
1 answer

maven jar/war plugin to add git hash commit id

I wanted to add the Git commit id in the manifest.mf file for jar. I have done the below configuration in pom xml plugin configuration, I am able to get the git revision when i issue the maven goal clean buildnumber:create install Is it possible to…
Ravi
  • 1,247
  • 4
  • 15
  • 35
1
vote
1 answer

Adding custom fields to build.properties generated by buildnumber-maven-plugin

I am using the buildnumber-maven-plugin to include various version parameters in my WAR artifact to be visible on the page. In my pom.xml: org.codehaus.mojo buildnumber-maven-plugin
amphibient
  • 29,770
  • 54
  • 146
  • 240
1
vote
0 answers

Perforce and maven buildnumber plugin

I am trying to use the buildnumber-maven-plugin (v1.4) with a Perforce repository. I am getting the following logged messages: [INFO] Got a revision during update: 4079887 [INFO] Storing buildNumber: null at timestamp: 1506951375881 The…
Karl Koster
  • 73
  • 1
  • 1
  • 7
1
vote
1 answer

git with maven-release-plugin and buildnumber-maven-plugin

When perform release I try to store the value of ${scmBranch} from buildnumber-maven-plugin to MANIFEST.MF file in my jar. But value is "UNKNOWN" and .../target/checkout/git branch say: * (no branch) revision same as tag revision. What to do with…
burtsevyg
  • 3,851
  • 2
  • 29
  • 44