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>
しかし、ディレクトリのすべてのコンテンツが含まれています...問題は何ですか?
ありがとうございました