spring_reference/X. Appendices/D.3.1. Launcher manifest.md

16 lines
738 B
Markdown
Raw Normal View History

2015-05-12 16:07:36 +00:00
### 附录D.3.1 Launcher manifest
2015-05-10 14:57:12 +00:00
你需要指定一个合适的Launcher作为`META-INF/MANIFEST.MF`的`Main-Class`属性。你实际想要启动的类也就是你编写的包含main方法的类需要在`Start-Class`属性中定义。
例如这里有个典型的可执行jar文件的MANIFEST.MF
```properties
Main-Class: org.springframework.boot.loader.JarLauncher
Start-Class: com.mycompany.project.MyApplication
```
对于一个war文件它可能是这样的
```properties
Main-Class: org.springframework.boot.loader.WarLauncher
Start-Class: com.mycompany.project.MyApplication
```
**注**你不需要在manifest文件中指定`Class-Path`实体classpath会从嵌套的jars中被推导出来。