1. 程式人生 > 實用技巧 >為防止maven匯出資源(xml)失敗

為防止maven匯出資源(xml)失敗

<build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.properties</include>
                    <include>**/*.xml</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> </build>

將java中的xml與properities包含進來

<build>
<resources>
<resource>
<directory
>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</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>
</build>