Springboot .properties或.yml配置文件读取pom.xml文件值

有时候配置文件需要读取pom文件配置<properties></properties>中间自定义属性值的时候可以用@@获取

例:@package.parameter@

然后还需要在pom.xml中打开过滤才可以

  <build>
        <resources>
            <resource>
          <!--指定resources插件处理哪个目录下的资源文件--> <directory>src/main/resources</directory>
          <!--打开资源过滤功能--> <filtering>true</filtering> </resource> </resources> </build>

猜你喜欢

转载自www.cnblogs.com/boris-et/p/11093016.html