【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:
相关推荐
开开心心就好5 小时前
操作简单的ISO文件编辑转换工具
java·前端·科技·edge·pdf·安全威胁分析·ddos
卷卷说风控5 小时前
工作流的 Skill 怎么写?
java·javascript·人工智能·chrome·安全
浮尘笔记5 小时前
Docker中安装Kafka以及基本配置和用法、踩坑记录
后端·docker·容器·kafka·php
却话巴山夜雨时i5 小时前
互联网大厂Java面试实录:从Spring Boot到Kafka的技术问答
spring boot·redis·flink·kafka·java面试·rest api·互联网大厂
IT_陈寒6 小时前
Python的异步陷阱:我竟然被await坑了一整天
前端·人工智能·后端
SunnyDays10116 小时前
Java实战指南:如何高效将PDF转换为高质量TIFF图片
java·pdf转tiff
Seven976 小时前
【从0到1构建一个ClaudeAgent】规划与协调-TodoWrite
java
Yeh2020586 小时前
maven
java·maven
色空大师6 小时前
【java打包方式详解】
java·开发语言·部署·打包·启动脚本·jar包分离