附录D.1.2. 可执行war文件结构

Spring Boot Loader兼容的war文件应该遵循以下结构:

  1. example.jar
  2. |
  3. +-META-INF
  4. | +-MANIFEST.MF
  5. +-org
  6. | +-springframework
  7. | +-boot
  8. | +-loader
  9. | +-<spring boot loader classes>
  10. +-WEB-INF
  11. +-classes
  12. | +-com
  13. | +-mycompany
  14. | +-project
  15. | +-YouClasses.class
  16. +-lib
  17. | +-dependency1.jar
  18. | +-dependency2.jar
  19. +-lib-provided
  20. +-servlet-api.jar
  21. +-dependency3.jar

依赖需要放到内嵌的WEB-INF/lib目录下。任何运行时需要但部署到普通web容器不需要的依赖应该放到WEB-INF/lib-provided目录下。