mangstadt / ez-vcard

A vCard parser library for Java
Other
399 stars 92 forks source link

Use MANIFEST.MF instead of ez-vcard.properties to get Maven properties #64

Open stonio opened 8 years ago

stonio commented 8 years ago

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:

mangstadt commented 8 years ago

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.