【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:
相关推荐
孤独风雪3 分钟前
Spring Stomp 消息使用
java·后端
间彧3 分钟前
ShardingSphere详解与SpringBoot实战分库分表指南
后端
IT探险家4 分钟前
Java 面向对象编程:5 个核心概念从生活到代码的完整映射
java
掘金一周6 分钟前
2026 春晚魔术大揭秘:作为程序员,分分钟复刻一个 | 掘金一周 2.26
前端·人工智能·后端
掘金者阿豪7 分钟前
Jenkins前端访问卡顿优化实战:从主题插件故障到性能调优全记录
后端
掘金者阿豪8 分钟前
时序数据库国产化替代的“深水区”:金仓数据库如何重构物联网数据底座
后端
JavaGuide18 分钟前
微信面试:什么是一致性哈希算法?适用什么场景?
后端·面试
我要神龙摆尾19 分钟前
JAVA版本演进全揽:你使用的JDK停留在哪个版本
java
Charlie_lll21 分钟前
力扣解题-88. 合并两个有序数组
后端·算法·leetcode
茶杯梦轩24 分钟前
从零起步学习并发编程 || 第九章:Future 类详解及CompletableFuture 类在项目实战中的应用
服务器·后端·面试