首页 > 技术文章 > 修改Spring boot内置的tomcat端口

caopt 原文

介绍两种种简单的修改spring boot内置端口的方法:

第一种:在入口直接设置端口,代码如下所示:

public static void main(String[] args){
        SpringApplication.run(TestSpringBoot.class, "--server.port=9999");
    }

第二种:步骤如下:

1、

2、

3、Apply一下重新运行main方法即可访问新端口

推荐阅读