maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Cohen <>
Subject Re: Howto access project version programmatically within application
Date Wed, 11 Jan 2012 19:41:20 GMT
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
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
Duh -  that's it.

However -- fixing that the code now sees the manifest.  However, the 
manifest it sees is not the one that I see when looking at the file in 
the jar with WinZip.

Here is META-INF/MANIFEST.MF in the jar:

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Build-Jdk: 1.6.0_23
Built-By: Steve
Implementation-Title: MyApp
Implementation-Version: 0.6.1-SNAPSHOT
Implementation-Vendor-Id: com.whatever
Main-Class: com.whatever.Main
SplashScreen-Image: SplashScreen.jpg

Yet when my app reads the manifest
( getResourceAsStream("META_INF/MANIFEST.MF" )
and then iterates through the manifest attributes, it sees this:

Manifest-Version : 1.0
Created-By : 1.4.2 (IBM Corporation)

If I specify instead
getResourceAsStream("/META_INF/MANIFEST.MF") then the file is not found.

I can't make any sense of these symptoms.  Manifests are just too weird, 
it seems.

Unless someone can explain this weirdness, I'll try the approach with

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message