<?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>${groupId}</groupId>
        <artifactId>${rootArtifactId}</artifactId>
        <version>${version}</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>${artifactId}</artifactId>
    <name>${artifactId}</name>
    <description>${artifactId} 调试/运行/测试/打包 模块</description>


    <dependencies>
        <dependency>
            <groupId>${groupId}</groupId>
            <artifactId>${rootArtifactId}-xxx</artifactId>
        </dependency>

        <!-- ============================= 中间件技术选型 ============================= -->

        <!-- 数据库选用 mysql -->
        <dependency>
            <groupId>${groupId}</groupId>
            <artifactId>${rootArtifactId}-storage-mysql</artifactId>
        </dependency>


    </dependencies>

    <profiles>
        <!-- 开发环境 -->
        <profile>
            <id>dev</id>
            <properties>
                <profile.active>dev</profile.active>
            </properties>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
        </profile>

        <!-- 测试环境-->
        <profile>
            <id>test</id>
            <properties>
                <profile.active>test</profile.active>
            </properties>
        </profile>

        <!-- 生产环境-->
        <profile>
            <id>prod</id>
            <properties>
                <profile.active>prod</profile.active>
            </properties>
        </profile>
    </profiles>

    <build>
        <!-- maven 默认使用 artifactId+version拼接 -->
        <finalName>${project.artifactId}</finalName>

        <!-- 动态打包环境配置源文件 -->
        <filters>
            <filter>../../dynamicConfig/config-${profile.active}.properties</filter>
        </filters>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*</include>
                </includes>
                <!-- 是否替换资源中的属性，properties.yml、banner 中需要获取应用版本号、名称、描述 -->
                <filtering>true</filtering>
            </resource>
        </resources>

    </build>

</project>
