【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:
相关推荐
玹外之音1 小时前
Spring AI 实战:手把手教你构建支持多会话管理的智能聊天服务
java·spring
callJJ2 小时前
Spring Bean 生命周期详解——从出生到销毁,结合源码全程追踪
java·后端·spring·bean·八股文
怒放吧德德2 小时前
AsyncTool + SpringBoot:轻量级异步编排最佳实践
java·后端
毅炼2 小时前
Java 集合常见问题总结(1)
java·后端
知识即是力量ol2 小时前
口语八股——Spring 面试实战指南(一):核心概念篇、AOP 篇
java·spring·面试·aop·八股·核心概念篇
utmhikari2 小时前
【架构艺术】治理后端稳定性的一些实战经验
java·开发语言·后端·架构·系统架构·稳定性·后端开发
文艺倾年2 小时前
【源码精讲+简历包装】LeetcodeRunner—手搓调试器轮子(20W字-上)
java·jvm·人工智能·tomcat·编辑器·guava
dfyx9992 小时前
Maven Spring框架依赖包
java·spring·maven
undefinedType2 小时前
Rails ActiveSupport::Cache 缓存存储详解
后端
茶杯梦轩3 小时前
从零起步学习并发编程 || 第二章:多线程与死锁在项目中的应用示例
java·服务器·后端