1
我想使用maven-resources-plugin將資源複製到另一個目錄。Maven和maven-resources-plugin
我的資源目錄有這樣的結構:
log4j.xml
xml
|_ resource-1
|_ resource-n
我想只有log4.xml複製到輸出目錄。這裏是我的插件代碼:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<outputDirectory>${glassfish.conf}</outputDirectory>
<resources>
<resource>
<directory>${conf.location}</directory>
<includes>
<include>**/log4j.xml</include>
</includes>
<excludes>
<exclude>**/xml/*</exclude>
</excludes>
</resource>
</resources>
</configuration>
<executions>
<execution>
<id>copy-log4j-to-glassfish</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
</execution>
</executions>
</plugin>
但是,所有被複制到輸出目錄(log4j.xml和xml目錄)。
我試圖
<resource>
<directory>${conf.location}</directory>
<excludes>
<exclude>**/xml/*</exclude>
</excludes>
</resource>
或者
<resource>
<directory>${conf.location}</directory>
<includes>
<include>**/log4j.xml</include>
</includes>
</resource>
即使
<resource>
<directory>${conf.location}</directory>
<excludes>
<exclude>**/*</exclude>
</excludes>
</resource>
但目錄下的所有內容將被包括...這是什麼問題?
謝謝
將'configuration'從'execution'中移出來的伎倆 –