[1] http://ajanthane.blogspot.com/2017/07/getting-started-with-spring-boot-sample.html.
When we extract the JAR, we will see the below structure.
Below is the summarized contents of the above folders.
When we check the MANIFEST-INF file, then we can identify which class get invoked as entry point. The main use of the MANIFEST-INF file is:
- Define the entry point of the Application, make the Jar executable.
- Add project dependency classpath.
Here, specifically when we look at the below two lines:
Main-Class: org.springframework.boot.loader.JarLauncher
Start-Class: org.test.springboot.Application
That means the first class which get invoked is org.springframework.boot.loader.JarLauncher and then only it will start the main class we have specified, in our case org.test.springboot.Application.
More information on this can be found at [2].
[2] https://docs.spring.io/spring-boot/docs/current/reference/html/executable-jar.html
That's it...
No comments:
Post a Comment