M
>> To: users@maven.apache.org
>> Subject: Re: Howto access project version programmatically within
>> application
>>
>> Hmm, intriguing but not working in my case which is a jar, not a war
> or
>> ear. This is standalone java app.
>>
>> I'
Looks like there are other jar (or classes directories) in classpath.
getRessourceAsStream() will access the first entry (according to current
classloader logic)
and this need not be the one from the jar you are interested in.
You might use getRessources() to get all candidates enumerated.
(Thi
On 01/11/2012 12:14 PM, Wayne Fay wrote:
getResourceAsStream("META_INF/MANIFEST.MF") and
getResourceAsStream("/META_INF/MANIFEST.MF") without success even though
I've verified that the file exists in the jar,
Uhh that should be META-INF, right?
Wayne
--
012 11:10 AM
> To: users@maven.apache.org
> Subject: Re: Howto access project version programmatically within
> application
>
> Hmm, intriguing but not working in my case which is a jar, not a war
or
> ear. This is standalone java app.
>
> I've tried
> getResourceAsStream(&quo
n-Version"));
System.out.println("Build: " + atts.getValue("Implementation-Build"));
-Original Message-
From: Steve Cohen [mailto:sco...@javactivity.org]
Sent: Wednesday, January 11, 2012 10:29 AM
To: users@maven.apache.org
Subject: Re: Howto access proj
> getResourceAsStream("META_INF/MANIFEST.MF") and
> getResourceAsStream("/META_INF/MANIFEST.MF") without success even though
> I've verified that the file exists in the jar,
Uhh that should be META-INF, right?
Wayne
-
To unsubsc
From: Steve Cohen [mailto:sco...@javactivity.org]
Sent: Wednesday, January 11, 2012 10:29 AM
To: users@maven.apache.org
Subject: Re: Howto access project version programmatically within
application
On 01/11/2012 10:50 AM, Stephen Connolly wrote:
getClass().getClassLoader().getPackage("")
ot; +
atts.getValue("Implementation-Version"));
System.out.println("Build: " + atts.getValue("Implementation-Build"));
> -Original Message-
> From: Steve Cohen [mailto:sco...@javactivity.org]
> Sent: Wednesday, January 11, 2012 10:29 AM
> To: users@
On 01/11/2012 10:50 AM, Stephen Connolly wrote:
getClass().getClassLoader().getPackage("").getImplementationVersion()
I really liked the simplicity of this idea. Alas,
ClassLoader.getPackage(String) is a protected method, so this won't help.
Accessible to me is:
Package.getPackage("").get
> ---- Original Message
> Subject: Re: Howto access project version programmatically within
> application
> Date: Wed, 11 Jan 2012 16:41:49 +0100
> From: Rainer Pruy
> Reply-To: Maven Users List
> Organization: Acrys Consult GmbH & Co. KG
> To: users@mave
k I need to roll my own manifest reader, since I AM encoding the
version there, or perhaps read the maven.properties.
Original Message ----
Subject: Re: Howto access project version programmatically within
application
Date: Wed, 11 Jan 2012 16:41:49 +0100
From: Rainer Pruy
Repl
Agreed.
I filter-copy a properties file with the following:
project.name=${project.name}
project.version=${project.version}
build.date=${build.date}
...
Then I can load this file and have at it.
matt
On Jan 11, 2012, at 7:48 AM, Mark H. Wood wrote:
> On Wed, Jan 11, 2012 at 09:07:29AM -0600,
On Wed, Jan 11, 2012 at 09:07:29AM -0600, Steve Cohen wrote:
> It appears that this entire class and the interface it is based on are
> deprecated, in favor of org.apache.maven.rtinfo.RuntimeInformation and
> org.apache.maven.rtinfo.internal.DefaultRuntimeInformation.
>
> But this non-deprecated
Hm, is this really heading into the direction you intended with your
question originally?
The api your are looking at is more for maven internal use (or for
dealing with maven world (poms, etc.).
If your "application" is into this direction you might find interesting
hints with maven plugin de
It appears that this entire class and the interface it is based on are
deprecated, in favor of org.apache.maven.rtinfo.RuntimeInformation and
org.apache.maven.rtinfo.internal.DefaultRuntimeInformation.
But this non-deprecated version of the interface/impl REMOVE the
getApplicationVersion() met
Thanks.
But according to this:
http://maven.apache.org/ref/3.0.4-SNAPSHOT/apidocs/org/apache/maven/execution/DefaultRuntimeInformation.html
the getApplicationVersion() method has been deprecated, with no
indication as to what I should use instead.
Also, it seems that this introduces a dependen
Just google org/apache/maven/execution/DefaultRuntimeInformation.java .
http://grepcode.com/file/repo1.maven.org/maven2/org.apache.maven/maven-core/2.0.5/org/apache/maven/execution/DefaultRuntimeInformation.java?av=h
Cheers,
Guillaume
Le 11/01/2012 15:03, Steve Cohen a écrit :
A solution to th
17 matches
Mail list logo