【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:
相关推荐
用户0921 小时前
Gradle Cache Entries 深度探索
android·java·kotlin
叽哥21 小时前
Kotlin学习第 9 课:Kotlin 实战应用:从案例到项目
android·java·kotlin
码事漫谈21 小时前
移动语义的里里外外:从 std::move 的幻象到性能的现实
后端
武子康1 天前
大数据-99 Spark Streaming 数据源全面总结:原理、应用 文件流、Socket、RDD队列流
大数据·后端·spark
双向331 天前
CI/CD 实战:GitHub Actions 自动化部署 Spring Boot 项目
后端
shark_chili1 天前
从入门到精通:Linux系统性能问题定位与解决方案大全
后端
bobz9651 天前
OVS-DOCA 符合 vDPA 设计
后端
bobz9651 天前
OVS-DOCA 和 VPP-DPDK 对比
后端
阿杆1 天前
同事嫌参数校验太丑,我直接掏出了更优雅的 SpEL Validator
java·spring boot·后端
无奈何杨1 天前
CoolGuard增加枚举字段支持,条件编辑优化,展望指标取值不同
前端·后端