### 新建配置文件: `src/main/resources/application.properties` ### 修改tomcat的端口号: ![](https://img.kancloud.cn/b7/3e/b73eb2228753038f3c963df6527422e2_759x188.png =1000x) 重新启动应用,访问浏览器测试: ![](https://img.kancloud.cn/d1/01/d10102c2d844824073f2e89afaf7ae26_626x253.png =1000x) ### 配置文件能写哪些内容? 参照官方文档: [https://docs.spring.io/spring-boot/docs/2.7.13/reference/html/index.html](https://docs.spring.io/spring-boot/docs/2.7.13/reference/html/index.html) 找到: Application Properties 左侧目录列出了各个部分可配置的项: ![](https://img.kancloud.cn/3a/82/3a822e053cebc5030b23087cad2498ee_997x669.png =1000x)