maven工程打包后 properties未能读到pom properties

来源:互联网 发布:mac上eclipse汉化 编辑:程序博客网 时间:2024/05/21 08:44

我的情况是因为给profile增加了finalName标签,resource标签的targetPath指向打包文件的路径,导致编译后target下classes里的properties和xml文件都未读取pom的properties。intellij内启动tomcat运行报错。

解决方法:
pom.xml build 标签增加:

<resources>

            <resource>
                <directory>src</directory>
                <includes>
                    <include>**/*.properties</include>
                    <include>**/*.xml</include>
                </includes>
                <filtering>true</filtering>
            </resource>
        </resources>