【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:
相关推荐
不惑_几秒前
Windows安装Java
java·开发语言·windows
程序员侠客行1 分钟前
Mybatis的Executor和缓存体系
java·后端·架构·mybatis
毕设源码-赖学姐1 分钟前
【开题答辩全过程】以 基于Java的化学实验室信息管理系统为例,包含答辩的问题和答案
java·开发语言
带刺的坐椅2 分钟前
通用流程编排框架,Solon Flow v3.8.0 隆重发布
java·solon·flowable·flow·drools
小王师傅662 分钟前
【轻松入门SpringBoot】actuator健康检查(中)
java·spring boot·spring
咕噜咕噜啦啦4 分钟前
Java速通(应用程序)
java·开发语言
爱学习的小可爱卢12 分钟前
JavaEE进阶——Spring Bean与Java Bean的核心区别
java·后端·java-ee
37手游后端团队14 分钟前
Cursor 工作区使用技巧:让 AI 真正理解你的多项目协作
后端·面试·架构
期待のcode16 分钟前
Java Object 类
java·开发语言
武子康16 分钟前
大数据-198 KNN 必须先归一化:Min-Max 正确姿势、数据泄露陷阱与 sklearn 落地
大数据·后端·机器学习