美文网首页
第八章:springboot2 yaml中使用pom.xml中的

第八章:springboot2 yaml中使用pom.xml中的

作者: 菜出意料 | 来源:发表于2023-12-08 08:08 被阅读0次

如果要在yaml中使用pom.xml中的配置,如@artifactId@,需要在pom.xml中增加配置

<plugins>  
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <configuration>
            <delimiters>@</delimiters>
            <useDefaultDelimiters>false</useDefaultDelimiters>
        </configuration>
    </plugin>
</plugins>
<!-- 必须添加下面的resource -->
<resources>
    <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
    </resource>
</resources>

示例:

图片.png

相关文章

网友评论

      本文标题:第八章:springboot2 yaml中使用pom.xml中的

      本文链接:https://www.haomeiwen.com/subject/wuyjgdtx.html