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
31
votes
6 answers

Is it possible to use maven buildnumber plugin to generate build number without any scm check?

Getting the following exception while using maven build number plugin. Is it possible to disable SCM check while using the build number plugin? Can we use this plugin to generate build number on non SCM build? Exception while doing the…
Joshan George
  • 668
  • 1
  • 7
  • 14
22
votes
4 answers

Maven build number plugin, how to save the build number in a file?

I've a Java project using Spring Framework and Git and I wanted to display a build number. I found the Build Number Maven plugin. With Git the build number is a Git hash. I dislike that and I thought a date was much more expressive. I found this…
stivlo
  • 83,644
  • 31
  • 142
  • 199
20
votes
2 answers

Can I set the project version with a buildnumber-maven-plugin?

I'm trying to add the svn.revision to project version as a build number and can't seem to do so. My jar has the correct name durin packaging, but its installed in the my local repository it is as if ${buildNumber} is/was undefined when the version…
Peter Kahn
  • 12,364
  • 20
  • 77
  • 135
18
votes
7 answers

Maven Buildnumber plugin - Git

The Maven Buildnumber plugin doesn't appear to work with GIT yet. Is there a workaround for the time being? I recently switched from SVN to GIT and have found it to be an easy transition, but this is the only thing that I don't have working…
Walter White
11
votes
2 answers

how to access properties defined in other module pom in maven multimodule project

In pom of A.B.C i have defined a property as abc where A B C are modules. Now i want to access that property in pom of A.D.F module. ${buildNumber}
HimanshuR
  • 1,390
  • 5
  • 16
  • 35
9
votes
4 answers

maven-buildnumber-plugin svn revision available only when not using format

While using the maven-buildnumber-plugin 1.0 beta 4, it seems that I can get the svn revision unless I use a tag within the configuration. Once I use and buildnumber tag, I get an auto-incrementing number, but it no…
gtrak
  • 5,598
  • 4
  • 32
  • 41
7
votes
3 answers

How to inject SVN revision number into JAR?

I want my JAR/WAR application to know what is the SVN revision number of its source code. I want this revision number to be later rendered for web end-users at the bottom of a web page, etc. Is there any existing Maven plugin to automate the…
yegor256
  • 102,010
  • 123
  • 446
  • 597
6
votes
5 answers

Inject the Mercurial working directory changeset id such as (838cb9c0367e) into properties file via Maven?

We use Maven for our builds and Mercurial for our changesets. While our software has a major version handled already we would really like to be able to know what Mercurial changeset was used to build any server that runs our software. Does anybody…
benstpierre
  • 32,833
  • 51
  • 177
  • 288
5
votes
4 answers

Hot to disable buildnumber-maven-plugin through cmd

I have question about maven. How can I disable buildnumber-maven-plugin through command line option. I want to run "mvn test" command on our continuous integration server, but this cmd failed because it trying to build a version and haven't access…
user1289877
  • 279
  • 6
  • 12
5
votes
1 answer

Maven properties in multi-module project are reset to default

I have a question regarding properties in a multi-module project. Consider the following 3-level project struture: project +- pom.xml (packaging: pom) //referred to as super-pom +- module_group +- pom.xml (packaging: pom) //referred to…
Thomas
  • 87,414
  • 12
  • 119
  • 157
5
votes
5 answers

Retrieve svn last changed revision number with the buildnumber-maven-plugin

I'm currently developing a microservice based architecture for my application. I've got a maven multi-module project which has many services, so I can easily deploy them to the docker hub using the maven deploy command and also a maven docker…
Aritz
  • 30,971
  • 16
  • 136
  • 217
5
votes
1 answer

How can I take build number using SVN and Maven?

I use buildnumber-maven-plugin and I need take build number of project from svn. My pom.xml: scm:svn:https://username:password@path_to_repositiry
RuF
  • 548
  • 1
  • 11
  • 31
5
votes
1 answer

SVN revision number and timestamp

I'm trying to display the latest SVN revision number and timestamp on the title bar of a web application. My current code displays the revision number but not timestamp. Both are not coming together. I'm using the following code.
coder247
  • 2,913
  • 19
  • 50
  • 70
4
votes
4 answers

Obtaining the Build ID in a Java Application

Does anyone have a simple suggestion for recording a build ID (generated at compile time) which is displayed in the title bar of the app at runtime? Building from within Eclipse, all I need is the ID, I can then pass it up to the title.
Mark Mayo
  • 12,230
  • 12
  • 54
  • 85
3
votes
1 answer

buildnumber-maven-plugin got svn: Authentication required for 'Subversion Repository' error

buildnumber-maven-plugin cannot check the latest revision number of the svn code base. pom config org.codehaus.mojo buildnumber-maven-plugin 1.0
George
  • 4,029
  • 2
  • 22
  • 26
1
2 3 4 5