-
Notifications
You must be signed in to change notification settings - Fork 40.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document how to handle MANIFEST.MF in native image with Maven #42412
Comments
More details ... The default classes directory is set to "target/classes" by native-maven-plugin If I run it like this
Then the app behaves as expected
I wonder if this is something worthy of a documentation, or a pre-configuration to native-maven-plugin - since it comes from spring boot parent in this case. native-image invocation before
native-image invocation after
Using JAR without .original suffix (spring boot fatjar) obviously fails
|
@krezovic thanks for the report.
Yes. And that is why our parent configures the native image maven plugin to use the Our best course of action is some documentation here. |
Leaving as a reference Another hint is required if you dynamically use manifest via ResourceLoader
Example code that works after adding the hint, but not before
|
When native image is built, there is no MANIFEST.MF for the application being built. Running "MyApp.class.getPackage().getImplementationVersion()" will return "null" in such scenario.
This is expected, as MANIFEST.MF is written by maven-jar-plugin, but native image build operates on target/classes dir itself.
How would one proceed with "get version of the currently running app" when running as native executable?
Consider the following example: https://github.com/krezovic/native-image-demo
will produce
Running
Running native executable, however
As expected, there's no MANIFEST.MF inside target/classes/META-INF
It is only present inside final JAR file
The text was updated successfully, but these errors were encountered: