解决IDEA编译JAVA后无法读取properties配置文件问题

ORG-M 6月前 ⋅ 773 阅读

针对maven管理项目

在pom文件中引入如下代码即可
 <build>
    <resources>
        <resource>
            <directory>${basedir}/src/main/java</directory>
            <includes>
                <include>**/*.properties</include>
                <include>**/*.xml</include>
            </includes>
        </resource>
        <resource>
            <directory>${basedir}/src/main/resources</directory>
        </resource>
    </resources>
 </build>

全部评论: 0

    我有话说: