Apache Maven资源插件排除目录 [英] Apache Maven Resources Plugin exclude a directory

查看:111
本文介绍了Apache Maven资源插件排除目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在构建过程中将一些资源从一个点复制到另一个.因此,我使用Apache Maven资源插件.实际上,我排除了一些不需要的文件.但我也想排除一个目录.我尝试了服务器方式,但是没有用.

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>

在此示例中,我尝试排除文件夹"p2".

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

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

也不起作用.

推荐答案

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

是正确的答案.

这篇关于Apache Maven资源插件排除目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆