【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:
相关推荐
程序员二叉6 分钟前
【Java】集合面试全套精讲|HashMap/ArrayList高频考点完整版
java·面试·哈希算法
cfm_291427 分钟前
JVM GC垃圾回收初步了解
java·开发语言·jvm
心之伊始38 分钟前
LangChain4j RAG 实战:Java 后端如何把本地文档接入 Embedding 检索链路
java·架构·源码分析·csdn
许彰午1 小时前
17_synchronized关键字深度解析
java·开发语言
阿正的梦工坊1 小时前
【Rust】02-变量、不可变性与基础类型
开发语言·后端·rust
Xzh04233 小时前
AI Agent 学习路线(Java 后端方向)
java·人工智能·学习
我叫黑大帅3 小时前
通过php 中的Route:: 的写法了解什么是静态类调用
后端·面试·php
JS菌3 小时前
AI Agent 沙箱双层防护体系:从权限过滤到内核隔离的完整实现
前端·人工智能·后端
艾利克斯冰3 小时前
Java 设计模式-行为型模式(更新中)
java·开发语言·设计模式
倒霉蛋小马3 小时前
Java新特性:record关键字
java·开发语言