SpringBoot的Profile文件

news/2024/7/6 5:58:42 标签: java

1、多Profile文件
我们在主配置文件编写的时候,文件名可以是application-{profile}.properties/yml
默认使用application.properties的配置

2、yml支持多文档块方式

server:
  port: 8081
Spring:
  profiles:
    active: prd
---
server:
  port: 8083
spring:
  profiles: dev

---
server:
  port: 8084
spring:
  profiles: prd  #指定属于哪个环境
application.properties

3、激活指定profile
1、在配置文件中指定spring.profiles.active=dev
2、命令行;
--spring.profiles.active=dev
java -jar spring-boot-02-config-0.0.1-SNAPSHOT.jar --spring.profiles.active=dev;
可以直接在测试的时候,配置传入命令行参数
3、虚拟机参数
-Dspring.profiles.active=dev

转载于:https://www.cnblogs.com/cykj/p/SpringBoot-Profile.html


http://www.niftyadmin.cn/n/1149051.html

相关文章

计算机程序的构造和解释 练习题2.82

先实现一个把参数转化为目标类型得辅助过程 (define (cast args target-type)(map (lambda (a) (if (eq? (type-tag a) target-type) a(let ((t1->t2 (get-coercion (type-tag a) target-type)))(if t1->t2 (t1->t2 a) a))))args))然后修改apply-generic过程&#x…

virtualenv 的基本应用

virtualenv --python/usr/bin/python3.5 course_python3.5_env 安装python3.5的虚拟环境 source course_python3.5_env/bin/activate 激活你想使用的虚拟环境版本 deactivate 是退出你现在所在的环境 转载于:https://www.cnblogs.com/zj0724/p/9113591.html

浏览器的事件机制

Propagation At this point, we should ask an important question—if an element and one of its ancestors have a handler on the same event, which handler will be fired first? Consider the following figure: For example, we have Element2 as a child of Element1…

计算机程序的构造和解释 练习题2.83

为整形和有理数都编写了相关得提升类型过程,同时加入公共方法raise x (define (raise x) (apply-generic raise x)) //放到install-rational-package包下面 (put raise (rational)(lambda (x) (make-complex-from-real-imag (/ (numer x) (denom x)) 0))) //放到in…

部署项目到远程tomcat的413 Request Entity Too Large报错处理

当项目jar包过多时,部署项目会报错而错误原因很清楚了,文件太大了。 因为用了nginx代理,而nginx默认文件大小有限,所以需要设置nginx上传文件大小限制 client_max_body_size 2m; 然后重新加载配置即可。 其实本可以不通过nginx转…

计算机程序的构造和解释 练习题2.84

加入三个辅助过程 high-level?判断t1是否高于t2 raise-type提升类型的层级到目标层级 find-high-level从参数中找到最高层级 程序的思路是找到参数里面的最高层级,然后将参数都提高的最高层级的类型,然后直接找到运算过程,进行运算。 (defi…

第12章 SpringBoot集成数据库

第12章 SpringBoot集成数据库 12.1 使用MyBatis 12.2 使用Spring Data JPA

计算机程序的构造和解释 练习题2.85

#lang racket (define (square x) (* x x)) ;put get实现 (define *op-table* (make-hash))(define (put op type proc)(hash-set! *op-table* (list op type) proc))(define (get op type)(hash-ref *op-table* (list op type) #f))(define *type-coercion* (make-hash))(defi…