Loading... 1.pom配置 <resources> <resource> <!--配置文件路径 --> <directory>src/main/resources</directory> <!--这里对应项目存放配置文件的目录--> <includes> <include>*.*</include> </includes> <!--开启filtering功能 --> <filtering>true</filtering> </resource> </resources> 2.配置Profile <!-- 多环境配置 --> <profiles> <profile> <id>dev</id> <!-- 环境标识,需要与配置文件的名称相对应 --> <properties> <active>dev</active> </properties> <!-- 默认环境 --> <activation> <activeByDefault>true</activeByDefault> </activation> </profile> <profile> <id>pro</id> <properties> <active>hwdmtest</active> </properties> </profile> </profiles> 3.引用 @active@ Last modification:January 30, 2023 © Allow specification reprint Support Appreciate the author AliPayWeChat Like 0 如果觉得我的文章对你有用,请随意赞赏