0
在默認的JHipster配置中,spring-boot-starter-web
的spring-boot-starter-tomcat
從其依賴關係中排除。排除tomcat的依賴的原因可能包括:Spring Boot排除Tomcat依賴性
- 部署戰成單獨的獨立Web應用程序服務器
- 交換Tomcat的依賴另一個Web服務器,如碼頭
(摘自pom.xml)
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
此外還提供了2個配置文件用於運行dev
或中的應用程序環境。這是我的困惑開始的地方......
在每個配置文件,一個額外的依賴聲明:
<profile>
<id>prod</id>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
</dependencies>
...
</profile>
有爲什麼spring-boot-starter-tomcat
依賴需要被排除在標準的依賴性和名單的理由然後包含在配置文件中?
那豈不是更好地從依賴刪除排除操作並具有:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
你爲什麼不試試?如果它工作在github上打開一個問題。 –