Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Getting "my" version information from a manifest file.

Reply
Thread Tools

Getting "my" version information from a manifest file.

 
 
GB
Guest
Posts: n/a
 
      01-21-2005
Can someone help & point out why this doesn't work please?

I have written a manifest file which contains;

Manifest-version: 1.0

Name: com/xyz/mylib/
Implementation-Title: com.xyz.mylib
Implementation-Version: 42
Implementation-Vendor: My Co

This is placed in the file manifest.mf in the META-INF directory in my jar.

But when I do this;

Package version_info = Package.getPackage("com.xyz.mylib");
String revision = version_info.getImplementationVersion();

revision is always set as null.

If I substitute "com.xyz.mylib" for "org.apache.log4j" (log4j being
one of the jars I use) then this works and I get revision set to
"1.2.8".

What have I missed?
 
Reply With Quote
 
 
 
 
R. Kevin Cole
Guest
Posts: n/a
 
      01-21-2005
Try removing the blank line after "Manifest-Version: 1.0" . I removed the blank line from
your example and it worked.


Hope this helps,

R. Kevin Cole


http://www.velocityreviews.com/forums/(E-Mail Removed) (GB) wrote:

>Can someone help & point out why this doesn't work please?
>
>I have written a manifest file which contains;
>
>Manifest-version: 1.0
>
>Name: com/xyz/mylib/
>Implementation-Title: com.xyz.mylib
>Implementation-Version: 42
>Implementation-Vendor: My Co
>
>This is placed in the file manifest.mf in the META-INF directory in my jar.
>
>But when I do this;
>
> Package version_info = Package.getPackage("com.xyz.mylib");
> String revision = version_info.getImplementationVersion();
>
>revision is always set as null.
>
>If I substitute "com.xyz.mylib" for "org.apache.log4j" (log4j being
>one of the jars I use) then this works and I get revision set to
>"1.2.8".
>
>What have I missed?


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting version information from the manifest Andrew Thompson Java 4 12-13-2008 09:06 PM
Re: Where to get stand alone Dot Net Framework version 1.1, version2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? MowGreen [MVP] ASP .Net 5 02-09-2008 01:55 AM
Re: Where to get stand alone Dot Net Framework version 1.1, version 2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? PA Bear [MS MVP] ASP .Net 0 02-05-2008 03:28 AM
Re: Where to get stand alone Dot Net Framework version 1.1, version 2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? V Green ASP .Net 0 02-05-2008 02:45 AM
using "Implementation-Version" in MANIFEST.MF to version war, jar and ear files thebad1 Java 3 02-02-2007 04:07 PM



Advertisments