【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:
相关推荐
万法若空2 小时前
【算法-查找】查找算法
java·数据结构·算法
葫芦和十三2 小时前
图解 MongoDB 30|查询路由与广播查询:带片键定向,不带就广播
后端·mongodb·agent
葫芦和十三2 小时前
图解 MongoDB 29|分片键陷阱:jumbo chunk、孤儿文档和写入热点
后端·mongodb·agent
进击的程序猿~3 小时前
Go Zero源码阅读1
后端·golang
2601_961593424 小时前
Rust 开发环境配置繁琐?RustRover 开箱即用搞定编码调试
开发语言·后端·macos·rust
HZZD_HZZD4 小时前
DL/T 645-2026新国标深度解读与智能电表协议适配实战:从帧结构变化到Java采集器升级的全链路改造方案
java·开发语言
犀利豆6 小时前
AI in Harness(三)
人工智能·后端
IT_陈寒7 小时前
Java的Stream.parallel()把我CPU跑爆了,这种优化要谨慎
前端·人工智能·后端
山登绝顶我为峰 3(^v^)37 小时前
C/C++ 交叉编译方法
java·c语言·c++