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

Unique SNAPSHOT version and buildNumber question...

I'm still trying to get my head around this and hope someone here can help.

When a SNAPSHOT build of our WAR files is deployed to Archiva, such as:

     MyApp-1.0.0-SNAPSHOT.war

the "SNAPSHOT" gets replaced with a unique timestamp/version number, such
as:

     MyApp-1.0.0-20130607.220924-2.war

I would like to have the exact version number (e.g.,
1.0.0-20130607.220924-2) in the MANIFEST.MF (or some other property file)
that can be made available in the application/service itself so we can
determine exactly what build is deployed to tomcat.

I've been glancing at the buildnumber-maven-plugin but I don't *think* it
will work because I need the unique SNAPSHOT version in the MANIFEST.MF to
correlate with the actual artifact timestamp in Archiva.

Has anyone done this and if so how?

Many thanks!

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

Re: Unique SNAPSHOT version and buildNumber question...

Posted by Jeff <pr...@gmail.com>.
Is this getting through?


On Thu, Jun 13, 2013 at 11:31 AM, Jeff <pr...@gmail.com> wrote:

> Anyone have suggestions on how to do this?
>
>
> On Wed, Jun 12, 2013 at 3:40 PM, Jeff <pr...@gmail.com> wrote:
>
>> I'm still trying to get my head around this and hope someone here can
>> help.
>>
>> When a SNAPSHOT build of our WAR files is deployed to Archiva, such as:
>>
>>      MyApp-1.0.0-SNAPSHOT.war
>>
>> the "SNAPSHOT" gets replaced with a unique timestamp/version number, such
>> as:
>>
>>      MyApp-1.0.0-20130607.220924-2.war
>>
>> I would like to have the exact version number (e.g.,
>> 1.0.0-20130607.220924-2) in the MANIFEST.MF (or some other property file)
>> that can be made available in the application/service itself so we can
>> determine exactly what build is deployed to tomcat.
>>
>> I've been glancing at the buildnumber-maven-plugin but I don't *think* it
>> will work because I need the unique SNAPSHOT version in the MANIFEST.MF to
>> correlate with the actual artifact timestamp in Archiva.
>>
>> Has anyone done this and if so how?
>>
>> Many thanks!
>>
>> --
>> Jeff Vincent
>> See my LinkedIn profile at:
>> http://www.linkedin.com/in/rjeffreyvincent
>> I ♥ DropBox <http://db.tt/9O6LfBX> !!
>>
>
>
>
> --
> Jeff Vincent
> See my LinkedIn profile at:
> http://www.linkedin.com/in/rjeffreyvincent
>



-- 
Jeff Vincent
See my LinkedIn profile at:
http://www.linkedin.com/in/rjeffreyvincent

Re: Unique SNAPSHOT version and buildNumber question...

Posted by Jeff <pr...@gmail.com>.
Anyone have suggestions on how to do this?


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

> I'm still trying to get my head around this and hope someone here can help.
>
> When a SNAPSHOT build of our WAR files is deployed to Archiva, such as:
>
>      MyApp-1.0.0-SNAPSHOT.war
>
> the "SNAPSHOT" gets replaced with a unique timestamp/version number, such
> as:
>
>      MyApp-1.0.0-20130607.220924-2.war
>
> I would like to have the exact version number (e.g.,
> 1.0.0-20130607.220924-2) in the MANIFEST.MF (or some other property file)
> that can be made available in the application/service itself so we can
> determine exactly what build is deployed to tomcat.
>
> I've been glancing at the buildnumber-maven-plugin but I don't *think* it
> will work because I need the unique SNAPSHOT version in the MANIFEST.MF to
> correlate with the actual artifact timestamp in Archiva.
>
> Has anyone done this and if so how?
>
> Many thanks!
>
> --
> Jeff Vincent
> See my LinkedIn profile at:
> http://www.linkedin.com/in/rjeffreyvincent
> I ♥ DropBox <http://db.tt/9O6LfBX> !!
>



-- 
Jeff Vincent
See my LinkedIn profile at:
http://www.linkedin.com/in/rjeffreyvincent

Re: Unique SNAPSHOT version and buildNumber question...

Posted by Jeff <pr...@gmail.com>.
Is there a way to tell Archiva to use the Maven version?  Unless there is
another plugin or goal I'm missing, I've used the buildnumber-maven-plugin
to set the version, but as soon as I deploy it is changed.  I hope I'm
missing something simple.


On Sun, Jun 16, 2013 at 9:51 PM, Brett Porter <br...@apache.org> wrote:

> Hi Jeff,
>
> If I'm understanding correctly, this is more of a Maven question, since
> you want it inside the artifact before it is deployed. However, Maven
> determines this value at deployment time, not build time, so it can't be
> baked in. The best thing to do is have your deployment or configuration
> management tool take care of writing that value out somewhere alongside the
> application. You can certainly leverage the Maven metadata in Archiva to do
> that.
>
> - Brett
>
> On 13/06/2013, at 7:40 AM, Jeff <pr...@gmail.com> wrote:
>
> > I'm still trying to get my head around this and hope someone here can
> help.
> >
> > When a SNAPSHOT build of our WAR files is deployed to Archiva, such as:
> >
> >     MyApp-1.0.0-SNAPSHOT.war
> >
> > the "SNAPSHOT" gets replaced with a unique timestamp/version number, such
> > as:
> >
> >     MyApp-1.0.0-20130607.220924-2.war
> >
> > I would like to have the exact version number (e.g.,
> > 1.0.0-20130607.220924-2) in the MANIFEST.MF (or some other property file)
> > that can be made available in the application/service itself so we can
> > determine exactly what build is deployed to tomcat.
> >
> > I've been glancing at the buildnumber-maven-plugin but I don't *think* it
> > will work because I need the unique SNAPSHOT version in the MANIFEST.MF
> to
> > correlate with the actual artifact timestamp in Archiva.
> >
> > Has anyone done this and if so how?
> >
> > Many thanks!
> >
> > --
> > Jeff Vincent
> > See my LinkedIn profile at:
> > http://www.linkedin.com/in/rjeffreyvincent
> > I ♥ DropBox <http://db.tt/9O6LfBX> !!
>
> --
> Brett Porter
> brett@apache.org
> http://brettporter.wordpress.com/
> http://au.linkedin.com/in/brettporter
> http://twitter.com/brettporter
>
>
>
>
>
>


-- 
Jeff Vincent
See my LinkedIn profile at:
http://www.linkedin.com/in/rjeffreyvincent

Re: Unique SNAPSHOT version and buildNumber question...

Posted by Brett Porter <br...@apache.org>.
Hi Jeff,

If I'm understanding correctly, this is more of a Maven question, since you want it inside the artifact before it is deployed. However, Maven determines this value at deployment time, not build time, so it can't be baked in. The best thing to do is have your deployment or configuration management tool take care of writing that value out somewhere alongside the application. You can certainly leverage the Maven metadata in Archiva to do that.

- Brett

On 13/06/2013, at 7:40 AM, Jeff <pr...@gmail.com> wrote:

> I'm still trying to get my head around this and hope someone here can help.
> 
> When a SNAPSHOT build of our WAR files is deployed to Archiva, such as:
> 
>     MyApp-1.0.0-SNAPSHOT.war
> 
> the "SNAPSHOT" gets replaced with a unique timestamp/version number, such
> as:
> 
>     MyApp-1.0.0-20130607.220924-2.war
> 
> I would like to have the exact version number (e.g.,
> 1.0.0-20130607.220924-2) in the MANIFEST.MF (or some other property file)
> that can be made available in the application/service itself so we can
> determine exactly what build is deployed to tomcat.
> 
> I've been glancing at the buildnumber-maven-plugin but I don't *think* it
> will work because I need the unique SNAPSHOT version in the MANIFEST.MF to
> correlate with the actual artifact timestamp in Archiva.
> 
> Has anyone done this and if so how?
> 
> Many thanks!
> 
> -- 
> Jeff Vincent
> See my LinkedIn profile at:
> http://www.linkedin.com/in/rjeffreyvincent
> I ♥ DropBox <http://db.tt/9O6LfBX> !!

--
Brett Porter
brett@apache.org
http://brettporter.wordpress.com/
http://au.linkedin.com/in/brettporter
http://twitter.com/brettporter