【SpringBoot】SpringBoot项目关于默认port以及context path的配置 application.yml

application.yml

server port [端口号]

配置/修改默认端口号
yaml 复制代码
# server configuration
  server:
    port: 8080

context path [虚拟目录]

配置/修改默认虚拟目录
yaml 复制代码
# server configuration
  server:
   servlet:
    context-path: /

spring configuration

yaml 复制代码
# spring configuration
spring:
  application:
    name: spring-boot-starter-web
    version: 1.0.0
    description: Spring Boot Starter Web
    author:
      name: "Johan"
      email: "johan@johan.com"
      url: "https://johan.com"
      company: "Johan"
      company-url: "https://johan.com"
      
      license:
        name: "Apache License 2.0"
        url: "https://www.apache.org/licenses/LICENSE-2.0"
        copyright: "Copyright (c) 2021 Johan"
        copyright-year: "2021"
        copyright-holder: "Johan"
        copyright-holder-url: "https://johan.com"
        copyright-license: "Apache License 2.0"
        copyright-license-url: "https://www.apache.org/licenses/LICENSE-2.0"
        copyright-license-text: |
          Licensed under the Apache License, Version 2.0 (the "License");
          you may not use this file except in compliance with the License.
          You may obtain a copy of the License at

              http://www.apache.org/licenses/LICENSE-2.0

          Unless required by applicable law or agreed to in writing, software
          
          
          
          
          distributed under the License is distributed on an "AS IS" BASIS, 
          WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.    
          See the License for the specific language governing permissions and
          limitations under the License.

logging configuration

yaml 复制代码
# logging configuration
#logging:
#  level:
相关推荐
不光头强6 分钟前
SpringBoot 开发第三天 学习内容
java·spring boot·学习
黎雁·泠崖10 分钟前
【魔法森林冒险】12/14 场景系统:5大场景的任务串联
java·开发语言
Vic1010131 分钟前
算法D1-20260212:双指针专题
java·数据结构·算法
大魔王7191 小时前
进程线程和协程一
后端
icebreaker1 小时前
Mokup:构建工具友好的可视化 Mock 工具
前端·javascript·后端
Codiggerworld1 小时前
从字节码到JVM:深入理解Java的“一次编写,到处运行”魔法
java·开发语言·jvm
_codemonster1 小时前
配置Tomcat时为啥要配置Artifacts
java·tomcat·firefox
无心水1 小时前
2025,一路有你!
java·人工智能·分布式·后端·深度学习·架构·2025博客之星
m0_528749001 小时前
C语言错误处理宏两个比较重要的
java·linux·算法