是否可以在同一端口上运行多个Spring Boot项目?

时间:2016-07-29 07:27:38

标签: spring spring-boot

是否可以在同一个端口上运行多个Spring Boot项目,方法是再构建一个项目并将这些项目添加为模块并运行。

2 个答案:

答案 0 :(得分:1)

来自Spring Boot Guide

  

如果您不小心运行了两次Web应用程序,则会看到“端口已在使用中”错误。 STS用户可以使用“重新启动”按钮而不是“运行”来确保关闭任何现有实例。

所以我猜测在同一个端口上运行两个启动实例是不可能的。我不认为可以在同一个端口上使用多个tomcat服务。有关tomcat的讨论,请参阅this

答案 1 :(得分:1)

如果您正在使用tomcat服务器behinde,则可以运行。

您也可以从application.properties更改应用程序的端口。 对于您的案例github.com/eugenp/spring-security-oauth,您只需继续https://github.com/eugenp/spring-security-oauth/blob/master/spring-security-oauth-server/src/main/resources/application.properties并将其更改为您想要的端口

相关问题