I migrated from Java 8 to Java 11 and from Ant project to Maven project, the manifest lost the Project version and build date information.
I printed all Main attributes of Manifest using the following code:
manifest = new Manifest(new URL(manifestPath).openStream());
Attributes attr = manifest.getMainAttributes();
// Enumerate each attribute
for (Iterator it=attr.keySet().iterator(); it.hasNext(); ) {
// Get attribute name
Attributes.Name attrName = (Attributes.Name)it.next();
String attrValue = attr.getValue(attrName);
AppLogger.getInstance().Log(attrName + ": " + attrValue);
}
Here is all the attributes names that I get: Main-Class, Class-Path, Build-Jdk, Built-By, Created-By, Manifest-Version, jar
There is no project version or build date.
What change should I do in my POM file, to add this information?