Apache Maven Resources Plugin Excludes Directory

I am trying to copy some resources from one point to another during the build process. Therefore, I use the Apache Maven Resources plugin. In fact, I exclude some files, I do not need this. But I also want to exclude the directory. I tried server-side methods, but that didn't work.

<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<executions>
    <execution>
        <id>copy-client-product</id>
        <phase>verify</phase>
        <goals>
            <goal>copy-resources</goal>
        </goals>
        <configuration>
            <outputDirectory>${basedir}/target/pro/client</outputDirectory>
            <resources>
                <resource>
                    <directory>target\products\client\win32\win32\x86\</directory>
                    <excludes>
                        <exclude>p2</exclude>
                        <exclude>eclipsec.exe</exclude>
                    </excludes>
                </resource>
            </resources>
        </configuration>
    </execution>
</executions>

In this example, I tried to exclude the "p2" folder.

<exclude>*/p2/**</exclude>
<exclude>p2/**</exclude>
<exclude>**/p2</exclude>

Also do not work.

+4
source share
2 answers

<exclude>**/p2/**</exclude>

- correct answer thanks to @khmarbaise.

+2
source

try it

<resource>
  <directory>p2</directory>
  <excludes>
      <exclude>p2/**</exclude>
   </excludes>
 </resource>
0
source

All Articles