1 Star 0 Fork 29

tracese / notebook

forked from JustryDeng / notebook 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
[03]pom中指定resource包含或排除的资源.md 1.88 KB
一键复制 编辑 原始数据 按行查看 历史

pom中指定resource包含或排除的资源

示例

<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
    <parent>
        <groupId>com.xxx</groupId>
        <artifactId>xxx</artifactId>
        <version>1.0.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>xxx</artifactId>
    
    <properties>
        <justrydeng.name>JustryDeng</justrydeng.name>
	</properties>
    

    <build>
        <!-- resources配置(指定除了正常的java编译文件外,还应该包含或者排除哪些文件) -->
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
            </resource>
            
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/**</include>
                </includes>
                <excludes>
                    <exclude>file/**</exclude>
                </excludes>
                <!-- 
                    是否将resources目录下的文件中的tokens(即通过@val@标识的变量)进行参数替换,替换为pom中对应的变量值。
                    如:在resource下的application.yml中,通过@justrydeng.name@即可对应取到上面pom中定义的值JustryDeng
                -->
                <filtering>false</filtering>
            </resource>
        </resources>
        
        <plugins>
           ...
        </plugins>
    </build>

</project>
1
https://gitee.com/Trace001/notebook.git
git@gitee.com:Trace001/notebook.git
Trace001
notebook
notebook
master

搜索帮助