ez-vcard
ez-vcard copied to clipboard
Use MANIFEST.MF instead of ez-vcard.properties to get Maven properties
Java class ezvcard.Ezvcard
currently parses file ez-vcard.properties to initialize constant values (VERSION
, GROUP_ID
, ARTIFACT_ID
and URL
).
However, we could easily get these values from file MANIFEST.MF . Example to retreive project version:
VERSION = Ezvcard.class.getPackage().getImplementationVersion();
Have you already studied this solution?
References:
- http://docs.oracle.com/javase/6/docs/technotes/guides/jar/jar.html
- http://blog.soebes.de/blog/2014/01/02/version-information-into-your-appas-with-maven/
Didn't know about that, thanks for the info.
Don't think the MANIFEST.MF approach would work, since ez-vcard generates an OSGi bundle. All the manifest attribute names start with "Bundle".
pom.properties
is nice, but it doesn't have the project URL in it. Plus, you have to know what the project's groupId and artifactId are in order to get the path to the file. What's even the point of putting these in the file if you have to know them in order to get the path to the file??
I think I may stick with the filtered property file approach.