Getting "my" version information from a manifest file.

G

GB

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?
 
R

R. Kevin Cole

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top