【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: "[email protected]"
      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:
相关推荐
天上掉下来个程小白6 分钟前
缓存套餐-01.Spring Cache入门案例
java·redis·spring·缓存·springboot·springcache
深色風信子19 分钟前
Eclipse 插件开发 6 右键菜单
java·ide·eclipse·右键菜单
网安INF22 分钟前
Apache Shiro 1.2.4 反序列化漏洞(CVE-2016-4437)
java·网络安全·apache
RedJACK~39 分钟前
Go语言Stdio传输MCP Server示例【Cline、Roo Code】
开发语言·后端·golang
it-搬运工41 分钟前
远程调用负载均衡LoadBalancer
java·微服务·负载均衡
努力努力再努力wz1 小时前
【Linux实践系列】:进程间通信:万字详解共享内存实现通信
java·linux·c语言·开发语言·c++
-曾牛1 小时前
Azure OpenAI 聊天功能全解析:Java 开发者指南
java·开发语言·人工智能·spring·flask·azure·大模型应用
bing_1581 小时前
Spring Boot 中如何启用 MongoDB 事务
spring boot·后端·mongodb
zhojiew2 小时前
service mesh的定制化与性能考量
java·云原生·service_mesh
cdut_suye2 小时前
【Linux系统】从零开始构建简易 Shell:从输入处理到命令执行的深度剖析
java·linux·服务器·数据结构·c++·人工智能·python