springboot的yml文件引用maven配置参数,统一配置

时间:2025-04-02 19:24:50

spring:
    application:
        name: @artifactId@
    profiles:
        active: @@

<artifactId>madp-sms-biz</artifactId>
<profiles>
   <profile>
      <id>dev</id>
      <properties>
         <!-- 环境标识,需要与配置文件的名称相对应 -->
         <>dev</>
      </properties>
      <activation>
         <!-- 默认环境 -->
         <activeByDefault>true</activeByDefault>
      </activation>
   </profile>
   <profile>
      <id>test</id>
      <properties>
         <>test</>
      </properties>
   </profile>
   <profile>
      <id>prod</id>
      <properties>
         <>prod</>
      </properties>
   </profile>
</profiles>