【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:
相关推荐
小村儿15 分钟前
给 AI Agent 装上"长期记忆":Karpathy 的 LLM Wiki 思想,我做成了工具
前端·后端·ai编程
何陋轩26 分钟前
Spring AI实战指南:在Java项目中集成大语言模型
人工智能·后端·机器学习
青山师1 小时前
动态代理深度解析:JDK与CGLIB底层实现与实战
java·设计模式·面试·动态代理·java面试·cglib
用户8356290780511 小时前
Python 操作 PowerPoint 表格的创建与格式化
后端·python
forestqq1 小时前
基于openeuler2403sp3的容器,打包django运行环境镜像
后端·python·django
放学后的泡泡1 小时前
提供一个工作流的表设计
java·设计规范
站着1 小时前
TRAE SOLO 移动端正式上线:手机也是随身工位,随时随地进入「Vibe Working」
后端
盖世英雄酱581362 小时前
6000条数据执行时间9s??
数据库·后端
用户8356290780512 小时前
使用 Python 处理 Word 文档书签
后端·python
生活真难2 小时前
SpringCloud - 任务调度 - xxl-job-java
java·spring boot·spring cloud