Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Maven Resources Plugin exclude a directory

I'm trying to copy some resources from one point to an other during the build process. Therefore I use the Apache Maven Resources Plugin. Actually I exclude some files, I don't need. But I want also to exclude a directory. I tried serveral ways but it 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 folder "p2".

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

Also don't work.

like image 576
kdoteu Avatar asked Jan 15 '15 14:01

kdoteu


2 Answers

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

is the correct answer thanks to @khmarbaise.

like image 121
Fares Droubi Avatar answered Sep 29 '22 09:09

Fares Droubi


Try this

<resource>
  <directory>p2</directory>
  <excludes>
      <exclude>p2/**</exclude>
   </excludes>
 </resource>
like image 35
Ignacio Gómez Sánchez Avatar answered Sep 29 '22 09:09

Ignacio Gómez Sánchez