【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:
相关推荐
猿究院--Cu-Sn合金2 分钟前
Spring Boot + DeepSeek 求职 Agent 实践:工具注册、多轮调用与简历 JD 对比
数据库·人工智能·spring boot·后端·deepseek
程序员cxuan4 分钟前
别学 subagent 了,很可能要凉了。
后端·agent·ai编程
小咕聊编程10 分钟前
基于Django的个人摄影博客网站设计与开发
后端·python·django
silvamux_17 分钟前
微头条爆款体平台适配实测:把交付要求变成可计算的指标
java·线性代数·算法·决策树·矩阵
论文复现现场17 分钟前
DeepSeek V4.1 Flash 和 V4 Pro 有什么区别?API 价格、性能与迁移建议
java·服务器·人工智能·python·大模型api·deepseek·deepseek v4.1
郭小李1 小时前
转发与重定向
java·服务器·数据库
你看我名字1 小时前
数眼智能 Search + Reader 实战:联网问答怎样避免“搜到了,却引用错了”
android·java·开发语言
未秃头的程序猿1 小时前
@ConditionalOnMissingBean 把我配好的 RabbitMQ 手动 ack 吃掉了
后端·rabbitmq
回家路上绕了弯1 小时前
当 AI 成为队友:团队协作使用 AI 的实践与思考
后端
guocy-ww1 小时前
JetBrains 全家桶(IDEA、PyCharm等)合法免费方案 审核中
pycharm·intellij-idea