【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:
相关推荐
摇滚侠8 分钟前
SpringBoot 工程,不是所有的服务都引入了 spring-boot-starter-amqp 依赖,我应该使用什么条件注解,判断配置类是否生效
java·spring boot·spring
花间相见14 分钟前
【JAVA基础03】—— JDK、JRE、JVM详解及原理
java·开发语言·jvm
勿芮介16 分钟前
【大模型应用】在window/linux上卸载OpenClaw
java·服务器·前端
kuntli18 分钟前
Java内部类四种类型解析
java
上进小菜猪19 分钟前
复杂 SQL 查询性能优化:深入解析 KingbaseES 的连接条件下推机制
后端
野犬寒鸦29 分钟前
面试常问:TCP相关(中级篇)问题原因即解决方案
服务器·网络·后端·面试
闻哥37 分钟前
深入剖析Redis数据类型与底层数据结构
java·jvm·数据结构·spring boot·redis·面试·wpf
虾..40 分钟前
Linux 基于TCP实现服务端客户端通信(多进程/多线程版)
java·服务器·tcp/ip
星辰_mya43 分钟前
CompletableFuture:异步编程的“智能机械臂”
java·开发语言·面试
北辰alk43 分钟前
性能调优实战:金仓数据库连接条件下推原理与案例拆解
后端