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上打开一个问题。 –