【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:
相关推荐
Aurorar0rua30 分钟前
CS50 x 2024 Notes C - 04
java·开发语言
椰羊~王小美38 分钟前
嵌入式 和 单片机
java·单片机·嵌入式硬件
低客的黑调41 分钟前
Redis-不止是缓存
java·开发语言·数据库
噢,我明白了1 小时前
Java 入门,详解List,Map集合使用
java·list·map
ZenosDoron1 小时前
函数形参传数组
java·jvm·算法
一只幸运猫.1 小时前
字节跳动Java大厂面试版
java·开发语言·面试
xier_ran1 小时前
【C++】“内部”、“外部”、“派生类”、“友元“类
java·开发语言·c++
地瓜伯伯1 小时前
SpringBoot项目整合Elasticsearch启动失败的常见错误总结
spring boot·elasticsearch·spring cloud
凭君语未可1 小时前
从静态代理走向动态代理:理解 JDK 动态代理的本质
java·开发语言
黑风风1 小时前
在 Windows 上设置 MAVEN_HOME 环境变量(完整指南)
java·windows·maven