Oh here is another fun one for you. You can put any attributes you want in a MANIFEST.MF.
So you can use it instead of loading some sort of custom properties file from the classpath.
That is instead of doing classpath:/application.properties and loading that up you can just load up the MANIFEST using JDK java.util.jar.Manifest.
So let us say you have custom meta/config data that is populated at build time you can have Maven store in the MANIFEST.MF.
Why would you do that? Well for one I think it is automatically graalvm friendly and two it avoids yet another resource load call (loading shit up from the classpath has surprising cost at times) since I think the MANIFEST.MF is always loaded (well at least the main jar it is).
View all comments
Show parent comment
7
u/agentoutlier Jan 02 '25
Oh here is another fun one for you. You can put any attributes you want in a MANIFEST.MF.
So you can use it instead of loading some sort of custom properties file from the classpath.
That is instead of doing
classpath:/application.propertiesand loading that up you can just load up the MANIFEST using JDKjava.util.jar.Manifest.So let us say you have custom meta/config data that is populated at build time you can have Maven store in the MANIFEST.MF.
Why would you do that? Well for one I think it is automatically graalvm friendly and two it avoids yet another resource load call (loading shit up from the classpath has surprising cost at times) since I think the MANIFEST.MF is always loaded (well at least the main jar it is).
In fact I should add that as an option to https://github.com/jstachio/ezkv