You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jeff <pr...@gmail.com> on 2013/06/12 20:17:58 UTC

Putting buildNumber into Manifest...

We have a continuous deployment system that constantly triggered by SCM
changes and builds/pushes our WAR files to our various environments.

I use the maven-war-plugin to insert specifics of the artifact into the
MANIFEST.MF.  However, the version for SNAPSHOTs is always in the form
1.1.1-SNAPSHOT, but would like to have it include the build number that
matches what is in our internal Maven Repository (e.g.,
1.1.1-2013050323423-27).

This might be a chicken and egg scenario, but is there a way to somehow use
the buildNumber in the MANIFEST instead of the SNAPSHOT qualifier so we can
easily see when troubleshooting which version is really deployed?

Thanks!

-- 
Jeff Vincent
See my LinkedIn profile at:
http://www.linkedin.com/in/rjeffreyvincent
I ♥ DropBox <http://db.tt/9O6LfBX> !!

Re: Putting buildNumber into Manifest...

Posted by Curtis Rueden <ct...@wisc.edu>.
Hi Jeff,

> is there a way to somehow use the buildNumber in the MANIFEST instead
> of the SNAPSHOT qualifier so we can easily see when troubleshooting
> which version is really deployed?

You can do something very close to what you want using the
buildnumber-maven-plugin. As Roy says, it will embed the SCM revision
rather than the SNAPSHOT timestamp, but then you can trace it back to the
code.

Here is how we do it in my projects:

https://github.com/scijava/scijava-common/blob/78ac31345e55e509ca44b5a416b83c79bec12bb6/pom-scijava/pom.xml#L161
https://github.com/scijava/scijava-common/blob/78ac31345e55e509ca44b5a416b83c79bec12bb6/pom-scijava/pom.xml#L213

Regards,
Curtis


On Wed, Jun 12, 2013 at 1:17 PM, Jeff <pr...@gmail.com> wrote:

> We have a continuous deployment system that constantly triggered by SCM
> changes and builds/pushes our WAR files to our various environments.
>
> I use the maven-war-plugin to insert specifics of the artifact into the
> MANIFEST.MF.  However, the version for SNAPSHOTs is always in the form
> 1.1.1-SNAPSHOT, but would like to have it include the build number that
> matches what is in our internal Maven Repository (e.g.,
> 1.1.1-2013050323423-27).
>
> This might be a chicken and egg scenario, but is there a way to somehow use
> the buildNumber in the MANIFEST instead of the SNAPSHOT qualifier so we can
> easily see when troubleshooting which version is really deployed?
>
> Thanks!
>
> --
> Jeff Vincent
> See my LinkedIn profile at:
> http://www.linkedin.com/in/rjeffreyvincent
> I ♥ DropBox <http://db.tt/9O6LfBX> !!
>

RE: Putting buildNumber into Manifest...

Posted by Martin Gainty <mg...@hotmail.com>.
 
Jeff
 
http://mojo.codehaus.org/buildnumber-maven-plugin/usage.html
 
i would suggest putting the buildnumber into <manifestEntries>
 inside the META-INF\manifest.mf

Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

 
> From: predatorvi@gmail.com
> Date: Wed, 12 Jun 2013 12:17:58 -0600
> Subject: Putting buildNumber into Manifest...
> To: users@maven.apache.org
> 
> We have a continuous deployment system that constantly triggered by SCM
> changes and builds/pushes our WAR files to our various environments.
> 
> I use the maven-war-plugin to insert specifics of the artifact into the
> MANIFEST.MF.  However, the version for SNAPSHOTs is always in the form
> 1.1.1-SNAPSHOT, but would like to have it include the build number that
> matches what is in our internal Maven Repository (e.g.,
> 1.1.1-2013050323423-27).
> 
> This might be a chicken and egg scenario, but is there a way to somehow use
> the buildNumber in the MANIFEST instead of the SNAPSHOT qualifier so we can
> easily see when troubleshooting which version is really deployed?
> 
> Thanks!
> 
> -- 
> Jeff Vincent
> See my LinkedIn profile at:
> http://www.linkedin.com/in/rjeffreyvincent
> I ♥ DropBox <http://db.tt/9O6LfBX> !!
 		 	   		  

Re: Putting buildNumber into Manifest...

Posted by "Lyons, Roy" <Ro...@cmegroup.com>.
You may be even more interested in injecting the version control tool's
code identification, like say the commit hash being built from git.  Then
you can trace it back to the code directly!


Thanks,

Roy Lyons




On 6/12/13 1:17 PM, "Jeff" <pr...@gmail.com> wrote:

>We have a continuous deployment system that constantly triggered by SCM
>changes and builds/pushes our WAR files to our various environments.
>
>I use the maven-war-plugin to insert specifics of the artifact into the
>MANIFEST.MF.  However, the version for SNAPSHOTs is always in the form
>1.1.1-SNAPSHOT, but would like to have it include the build number that
>matches what is in our internal Maven Repository (e.g.,
>1.1.1-2013050323423-27).
>
>This might be a chicken and egg scenario, but is there a way to somehow
>use
>the buildNumber in the MANIFEST instead of the SNAPSHOT qualifier so we
>can
>easily see when troubleshooting which version is really deployed?
>
>Thanks!
>
>-- 
>Jeff Vincent
>See my LinkedIn profile at:
>http://www.linkedin.com/in/rjeffreyvincent
>I ♥ DropBox <http://db.tt/9O6LfBX> !!


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org