spring_reference/X. Appendices/D.4. PropertiesLauncher Fea...

17 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

### D.4. PropertiesLauncher特性
PropertiesLauncher有一些特殊的性质它们可以通过外部属性来启用系统属性环境变量manifest实体或application.properties
|Key|作用|
|----|:-----|
|loader.path|逗号分割的classpath比如`lib:${HOME}/app/lib`|
|loader.home|其他属性文件的位置,比如[/opt/app](file:///opt/app)(默认为`${user.dir}`|
|loader.args|main方法的默认参数以空格分割|
|loader.main|要启动的main类名称比如`com.app.Application`|
|loader.config.name|属性文件名比如loader默认为application|
|loader.config.location|属性文件路径,比如`classpath:loader.properties`默认为application.properties|
|loader.system|布尔标识表明所有的属性都应该添加到系统属性中默认为false|
Manifest实体keys通过大写单词首字母及将分隔符从"."改为"-"(比如`Loader-Path`)来进行格式化。`loader.main`是个特例它是通过查找manifest的`Start-Class`这样也兼容JarLauncher。