• springboot-多环境测试


    1、application.properties中添加spring.profiles.active=test

    2、同级目录下创建application-dev.properties、application-test.properties、application-prod.properties三个文件。

    3、定义端口

    application-dev.properties中

    #开发环境
    server.port=8080

    application-test.properties中

    #测试环境
    server.port=8081

    pplication-prod.properties中

    #生产环境
    server.port=8082

    备注:

    在此一定要注意:

    profile的配置文件可以按照application.properyies的放置位置一样,放于以下四个位置,

    1.当前目录的 “/config”的子目录下

    2.当前目录下

    3.classpath根目录的“/config”包下

    4.classpath的根目录下

  • 相关阅读:
    班课6
    lesson one
    班课5
    ES6之Proxy及Proxy内置方法
    ES6模板字符串
    ES6之Symbol
    ES6对象及ES6对象简单拓展
    ES6函数的拓展
    ES6数组及数组方法
    ES6字符串方法
  • 原文地址:https://www.cnblogs.com/lichangyunnianxue/p/9680892.html
Copyright © 2020-2023  润新知