Maven-从构建中排除文件夹 [英] Maven - exclude folder from build

查看:98
本文介绍了Maven-从构建中排除文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试从我的版本中排除文件夹src/main/resources/scripts/,但以下操作不起作用:

Trying to exlcude a folder src/main/resources/scripts/ from my build but the following does not work:

<build>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <excludes>
                <exclude>src/main/resources/scripts/</exclude>
            </excludes>
        </resource>
    </resources>

    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <excludes>
                    <exclude>src/main/resources/scripts/</exclude>
                </excludes>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
    </plugins>
</build>

有什么想法吗?

推荐答案

相反,请尝试:

<exclude>scripts/**</exclude>

排除基于目录,因此您的构造将排除

The exclude is based on directory, so your construction would exclude

src/main/resources/src/main/resources/scripts

这篇关于Maven-从构建中排除文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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