使用idea時,maven項目中的resources中的文件不能加載到classes下

在pom.xml中的build中加入,這樣就能夠加載到classpath中java

<!--配置Maven 對resource文件 過濾 -->
<resources>
    <resource>
        <directory>src/main/resources</directory>
        <includes>
            <include>**/*.properties</include>
            <include>**/*.xml</include>
            <include>**/*.xls</include>
            <include>**/*.xlsx</include>
        </includes>
        <filtering>true</filtering>
    </resource>
    <resource>
        <directory>src/main/java</directory>
        <includes>
            <include>**/*.properties</include>
            <include>**/*.xml</include>
        </includes>
        <filtering>true</filtering>
    </resource>
</resources>
相關文章
相關標籤/搜索