Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the BOOT-INF and META-INF directories in a Spring-Boot JAR?

When I open a jar package, there shows the BOOT-INF and META-INF folders, what's the function of them?

's th

like image 991
user7693832 Avatar asked Jul 15 '19 06:07

user7693832


People also ask

What is boot INF and META-INF?

This is a single jar Spring Boot application. In addition to the META-INF files for the loader (as in any other jar file) the application itself is placed under BOOT-INF. Note that such a jar cannot be used as a traditional jar any more. Follow this answer to receive notifications.

What is META-INF folder in spring boot?

META-INF is intended to contain the MANIFEST. MF file and the services subdirectory related to the ServiceLoader class, but other frameworks, including Spring, use it as well.

What is META-inf in jar?

The META-INF directory, if it exists, is used to store package and extension configuration data, including security, versioning, extension and services.

What is spring boot fat jar?

Spring Boot is known for its “fat” JAR deployments, where a single executable artifact contains both the application code and all of its dependencies. Boot is also widely used to develop microservices.


2 Answers

The META-INF folder is the home for the MANIFEST.MF file. This file contains meta data about the contents of the JAR. For example, there is an entry called Main-Class that specifies the name of the Java class with the static main() for executable JAR files.

for more details

BOOT-INF : Spring Boot applications load from the BOOT-INF folder. Therefore the application classes must be placed in a nested BOOT-INF/classes directory. Dependencies should be placed in a nested BOOT-INF/lib directory.

more about Spring Boot packaging

like image 130
Istiaque Hossain Avatar answered Oct 11 '22 17:10

Istiaque Hossain


This is a single jar Spring Boot application.

In addition to the META-INF files for the loader (as in any other jar file) the application itself is placed under BOOT-INF.

Note that such a jar cannot be used as a traditional jar any more.

like image 2
Thorbjørn Ravn Andersen Avatar answered Oct 11 '22 17:10

Thorbjørn Ravn Andersen