You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Mark H. Wood" <mw...@IUPUI.Edu> on 2013/01/18 17:48:19 UTC

How to get Maven's own version into an artifact?

There's a desire for our product to be able to say, at runtime, what
version of Maven was used to build it.  Somewhat surprisingly I wasn't
able to find a predefined property holding this information.

There *is* a class one can instantiate which offers a method to return
that information, but before I go writing up a whole plugin just for
this little thing, I thought I should ask if there's an easier way
that I missed.

Ultimately I will likely filter the value into a Properties-formatted
file to be loaded at need.

-- 
Mark H. Wood, Lead System Programmer   mwood@IUPUI.Edu
There's an app for that:  your browser

Re: How to get Maven's own version into an artifact?

Posted by Baptiste MATHUS <ml...@batmat.net>.
If it works, go for Olivier'd answer.

If for whatever reason you can't upgrade jar plugin or read the manifest,
there's also a goal in build-helper-maven-plugin (currently offline and
dont remember the name) that will create a runtime property you can use
wherever you want.

Cheers
Le 18 janv. 2013 17:53, "Olivier Lamy" <ol...@apache.org> a écrit :

> Last version of jar plugin should add an entry in MANIFEST
> with Created-By: Apache Maven ${maven.version}
>
> 2013/1/18 Mark H. Wood <mw...@iupui.edu>:
> > There's a desire for our product to be able to say, at runtime, what
> > version of Maven was used to build it.  Somewhat surprisingly I wasn't
> > able to find a predefined property holding this information.
> >
> > There *is* a class one can instantiate which offers a method to return
> > that information, but before I go writing up a whole plugin just for
> > this little thing, I thought I should ask if there's an easier way
> > that I missed.
> >
> > Ultimately I will likely filter the value into a Properties-formatted
> > file to be loaded at need.
> >
> > --
> > Mark H. Wood, Lead System Programmer   mwood@IUPUI.Edu
> > There's an app for that:  your browser
>
>
>
> --
> Olivier Lamy
> Talend: http://coders.talend.com
> http://twitter.com/olamy | http://linkedin.com/in/olamy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: How to get Maven's own version into an artifact?

Posted by Anders Hammar <an...@hammar.net>.
This requires Maven 3.0.4+.

/Anders


On Fri, Jan 18, 2013 at 5:52 PM, Olivier Lamy <ol...@apache.org> wrote:

> Last version of jar plugin should add an entry in MANIFEST
> with Created-By: Apache Maven ${maven.version}
>
> 2013/1/18 Mark H. Wood <mw...@iupui.edu>:
> > There's a desire for our product to be able to say, at runtime, what
> > version of Maven was used to build it.  Somewhat surprisingly I wasn't
> > able to find a predefined property holding this information.
> >
> > There *is* a class one can instantiate which offers a method to return
> > that information, but before I go writing up a whole plugin just for
> > this little thing, I thought I should ask if there's an easier way
> > that I missed.
> >
> > Ultimately I will likely filter the value into a Properties-formatted
> > file to be loaded at need.
> >
> > --
> > Mark H. Wood, Lead System Programmer   mwood@IUPUI.Edu
> > There's an app for that:  your browser
>
>
>
> --
> Olivier Lamy
> Talend: http://coders.talend.com
> http://twitter.com/olamy | http://linkedin.com/in/olamy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: How to get Maven's own version into an artifact?

Posted by Olivier Lamy <ol...@apache.org>.
Last version of jar plugin should add an entry in MANIFEST
with Created-By: Apache Maven ${maven.version}

2013/1/18 Mark H. Wood <mw...@iupui.edu>:
> There's a desire for our product to be able to say, at runtime, what
> version of Maven was used to build it.  Somewhat surprisingly I wasn't
> able to find a predefined property holding this information.
>
> There *is* a class one can instantiate which offers a method to return
> that information, but before I go writing up a whole plugin just for
> this little thing, I thought I should ask if there's an easier way
> that I missed.
>
> Ultimately I will likely filter the value into a Properties-formatted
> file to be loaded at need.
>
> --
> Mark H. Wood, Lead System Programmer   mwood@IUPUI.Edu
> There's an app for that:  your browser



-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

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