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
1
vote
1 answer

Use custom git command with buildnumber-maven-plugin

I'm currently working on automating the build process (more or less) using maven. I need to create an rpm but in order to do so, I need to retrieve the latest version. As part of the convention, we're using GIT's tags to store the version of the…
Royi Freifeld
  • 629
  • 2
  • 11
  • 31
1
vote
2 answers

How to rename buildNumber property name in buildnumber-maven-plugin

How to rename buildNumber property name in buildnumber-maven-plugin as mentioned in: http://mojo.codehaus.org/buildnumber-maven-plugin/create-mojo.html#buildNumberPropertyName buildNumberPropertyName: You can rename the buildNumber property name to…
HimanshuR
  • 1,390
  • 5
  • 16
  • 35
1
vote
2 answers

How to print build timestamp with build number using maven jgit build number plugin?

I am trouble with generating build number using maven plugin, I have the plugin configuration in pom file like ru.concerteza.buildnumber
snehal
  • 1,798
  • 4
  • 17
  • 24
1
vote
1 answer

How to generated Build number with Git repository using Maven Build number plugin ?

I am configuring maven build number plugin with Git repository in my project, its working fine in my local machine. If I am building code in my local machine using maven ,so the generated build number is from my local machine or it takes from Git…
snehal
  • 1,798
  • 4
  • 17
  • 24
1
vote
1 answer

Using buildnumber-maven-plugin with jetty-maven-plugin

I'm using buildnumber-maven-plugin to add the build number from the latest github commit to the name of the generated war: org.apache.maven.plugins maven-war-plugin 2.4
Jon
  • 9,815
  • 9
  • 46
  • 67
1
vote
0 answers

Maven issue with buildnumber:hgchangeset properties not propagating to children

I have a multi-module project which uses the buildnumber:hgchangeset plugin to generate changeSet and changeSetDate properties, which then get blatted out into the manifest for each module, like so: pom.xml (parent):
Exponent
  • 492
  • 1
  • 11
  • 18
1
vote
0 answers

How can set properties for determine last commit revision and author in maven?

I want to get SCM url, last commit revision and last commit author so I can add them as metadata in my jar. I know I can get URL and revision but don't see a plugin which sets last commit author as a property. last commit revision ${buildnumber}…
Peter Kahn
  • 12,364
  • 20
  • 77
  • 135
1
vote
2 answers

How to enable Maven to see binary in $PATH?

I'm trying to add the buildnumber maven plugin to include the hgchangeset from mercurial. This works great for me when running in the Terminal (I'm on Mac OSX). org.codehaus.mojo
Cuga
  • 17,668
  • 31
  • 111
  • 166
1
vote
2 answers

Get git SHA-1 of code merged by jenkins into maven

I am using the "Merge before build" option of the git plugin to build a maven job. I have tried using ${GIT_BRANCH} and ${GIT_COMMIT} in my maven pom to write the commit information into my built artifacts but these variable are set to the branch…
Steve Brown
  • 195
  • 1
  • 8
0
votes
0 answers

Error: Execution default of goal org.codehaus.mojo:buildnumber-maven-plugin:1.4:create failed: The scm url cannot be null

[ERROR] Failed to execute goal org.codehaus.mojo:buildnumber-maven-plugin:1.4:create (default) on project common.model: Execution default of goal org.codehaus.mojo:buildnumber-maven-plugin:1.4:create failed: The scm url cannot be null. Am getting…
0
votes
1 answer

How to get automate versioning after pushing to Gitlab by changing Jekinsfile config

I have a Jekinsfile configuration for my project, I want to make some changes to the file in order to get automatic build number. I added 1.0.BUILD_NUMBER by myself, I'm new to this jenkins pipeline, feeling very confused can anyone help me? Been…
0
votes
1 answer

How to get branch into manifest

Using the buildnumber maven plugin, I would like to get the branch stored in my jar manifest. I have tried it two different ways, shown below. Here is the output from my build (relevant section only) [INFO] --- buildnumber-maven-plugin:1.4:create…
Paul Gregoire
  • 9,715
  • 11
  • 67
  • 131
0
votes
1 answer

Why isn't mvn resources:resources picking up buildNumber?

I've got a maven project that uses the buildnumber-maven-plugin. If I run mvn validate I see it's working: [INFO] --- buildnumber-maven-plugin:1.3:create (default) @ myproject --- [INFO] Executing: /bin/sh -c cd /Users/rob/Workspace/myproject && git…
Rob N
  • 15,024
  • 17
  • 92
  • 165
0
votes
0 answers

Maven war manifest entries blank when writing to manifest

I'm trying to add branch and build information to my war's manifest and while the keys show up on the manifest, the values are null. The values I'm pulling from the buildnumber-maven-plugin, and when this plugin executes the log shows the values. I…
0
votes
1 answer

Eclipse m2e overwrites buildNumber from buildnumber-maven-plugin

I'm using Eclipse m2e, buildnumber-maven-plugin, and templating-maven-plugin to create a filtered java file with ${buildNumber}. Here is a sample from the src/main/java-templates/build.java file: public static final String BUILDNUMBER =…
Mike Cooper
  • 1,065
  • 3
  • 13
  • 34