一直记得META-INF中只有在直接启动jar可执行文件时需要在manifest中配置启动类,最近看dubbo的配置,发现dubbo的配置都丢在META-INF下,特地搜索了下,官网对于META-INF的说明如下:
The META-INF directory
The following files/directories in the META-INF directory are recognized and interpreted by the Java 2 Platform to configure applications, extensions, class loaders and services:
- MANIFEST.MF
The manifest file that is used to define extension and package related data.
- INDEX.LIST
This file is generated by the new "-i" option of the jar tool, which contains location information for packages defined in an application or extension. It is part of the JarIndex implementation and used by class loaders to speed up their class loading process.
- x.SF
The signature file for the JAR file. 'x' stands for the base file name.
- x.DSA
The signature block file associated with the signature file with the same base file name. This file stores the digital signature of the corresponding signature file.
- services/
This directory stores all the service provider configuration files.
一般来说,META-INF下不会存储和应用配置相关的信息。而且可以认为是Java自己的元数据目录。其他应用配置,应该放在其他目录比如conf。
本文详细介绍了Java应用程序中META-INF目录的作用及其包含的主要文件,如MANIFEST.MF、INDEX.LIST等,并解释了这些文件如何帮助配置应用程序、扩展、类加载器和服务。
1535

被折叠的 条评论
为什么被折叠?



