Maven配置资源过滤excludes没有作用???搞了很久没能明白???,求解

发布于 2022-09-04 10:36:06 字数 2188 浏览 15 评论 0

这是我的项目结构
clipboard.png

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <artifactId></artifactId>
    <packaging>war</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name></name>
    <url>http://maven.apache.org</url>

    <properties>
        <spring.version>4.0.5.RELEASE</spring.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        
    </dependencies>

    <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>

        <filters>
            
        </filters>

        <resources>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
                <filtering>true</filtering>
                <excludes>
                    <exclude>generatorConfig.xml</exclude>
                </excludes>
            </resource>
        </resources>
    </build>
</project>

我想在打包的时候把srcmainresoursgeneratorConfig.xml的这个文件过滤掉,但是配置没有用?求解???

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

落花随流水 2022-09-11 10:36:06

Maven Resources Plugin

The mapping matches URLs using the following rules:

  • * matches zero or more characters (匹配0个或N个字符)

  • ** matches zero or more directories in a path (匹配0个或N个目录)

Examples

  • com/*.jsp — matches all .jsp files in the com directory

  • com/**/test.jsp — matches all test.jsp files underneath the com path


楼主可以将表达式写成如下尝试:

<excludes>
    <exclude>**/generatorConfig.xml</exclude>
</excludes>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文