<?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">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.zt.plat</groupId>
    <artifactId>dsc-qms</artifactId>
    <version>${revision}</version>
    <packaging>pom</packaging>
    <modules>
        <module>zt-module-qms</module>
        <module>qms-server</module>
    </modules>

    <name>${project.artifactId}</name>
    <description>芋道项目基础脚手架</description>
    <url>https://github.com/YunaiV/ruoyi-vue-pro</url>

    <properties>
        <revision>3.0.47-SNAPSHOT</revision>
        <!-- qms服务相关 -->
        <zzjc.tio.version>3.9.1.v20251204-RELEASE</zzjc.tio.version>
        <liteflow.version>2.15.3</liteflow.version>
        <!-- Maven 相关 -->
        <java.version>17</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <maven-surefire-plugin.version>3.2.2</maven-surefire-plugin.version>
        <maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
        <flatten-maven-plugin.version>1.6.0</flatten-maven-plugin.version>
        <!-- 看看咋放到 bom 里 -->
        <lombok.version>1.18.36</lombok.version>
        <spring.boot.version>3.4.5</spring.boot.version>
        <mapstruct.version>1.6.3</mapstruct.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.zt.plat</groupId>
                <artifactId>zt-dependencies</artifactId>
                <version>${revision}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            
            <!-- liteflow -->
            <dependency>
                <groupId>com.yomahub</groupId>
                <artifactId>liteflow-spring-boot-starter</artifactId>
                <version>${liteflow.version}</version>
            </dependency>
            <dependency>
                <groupId>com.yomahub</groupId>
                <artifactId>liteflow-script-javax-pro</artifactId>
                <version>${liteflow.version}</version>
            </dependency>
            <dependency>
                <groupId>com.yomahub</groupId>
                <artifactId>liteflow-script-groovy</artifactId>
                <version>${liteflow.version}</version>
            </dependency>
            <dependency>
                <groupId>com.yomahub</groupId>
                <artifactId>liteflow-script-qlexpress</artifactId>
                <version>${liteflow.version}</version>
            </dependency>
            <dependency>
                <groupId>com.yomahub</groupId>
                <artifactId>liteflow-script-graaljs</artifactId>
                <version>${liteflow.version}</version>
            </dependency>
            
            <!-- tio -->
            <dependency>
                <groupId>tech.zzjc.tio</groupId>
                <artifactId>zzjc-tio-spring-boot-starter</artifactId>
                <version>${zzjc.tio.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <!-- maven-surefire-plugin 插件，用于运行单元测试。 -->
                <!-- 注意，需要使用 3.0.X+，因为要支持 Junit 5 版本 -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
                <!-- maven-compiler-plugin 插件，解决 Lombok + MapStruct 组合 -->
                <!-- https://stackoverflow.com/questions/33483697/re-run-spring-boot-configuration-annotation-processor-to-update-generated-metada -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <annotationProcessorPaths>
                            <path>
                                <groupId>org.springframework.boot</groupId>
                                <artifactId>spring-boot-configuration-processor</artifactId>
                                <version>${spring.boot.version}</version>
                            </path>
                            <path>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok</artifactId>
                                <version>${lombok.version}</version>
                            </path>
                            <path>
                                <groupId>org.mapstruct</groupId>
                                <artifactId>mapstruct-processor</artifactId>
                                <version>${mapstruct.version}</version>
                            </path>
                        </annotationProcessorPaths>
                        <!-- 编译参数写在 arg 内，解决 Spring Boot 3.2 的 Parameter Name Discovery 问题 -->
                        <debug>false</debug>
                        <compilerArgs>
                            <arg>-parameters</arg>
                        </compilerArgs>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <!-- 统一 revision 版本 -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>flatten-maven-plugin</artifactId>
                <version>${flatten-maven-plugin.version}</version>
                <configuration>
                    <flattenMode>oss</flattenMode>
                    <updatePomFile>true</updatePomFile>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>flatten</goal>
                        </goals>
                        <id>flatten</id>
                        <phase>process-resources</phase>
                    </execution>
                    <execution>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                        <id>flatten.clean</id>
                        <phase>clean</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <!-- 只对 yaml 文件过滤 -->
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.yml</include>
                    <include>**/*.yaml</include>
                </includes>
                <filtering>true</filtering>
            </resource>
            <!-- 其他文件不做过滤 -->
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>**/*.yml</exclude>
                    <exclude>**/*.yaml</exclude>
                </excludes>
                <filtering>false</filtering>
            </resource>
        </resources>
    </build>

    <!-- 使用 huawei / aliyun 的 Maven 源，提升下载速度 -->
    <repositories>
        <repository>
            <id>ZT</id>
            <name>中铜 ZStack 私服</name>
            <url>http://172.16.46.63:30708/repository/zt-cloud/</url>
            <releases>
                <updatePolicy>always</updatePolicy>
                <checksumPolicy>warn</checksumPolicy>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
            </snapshots>
        </repository>
    </repositories>

    <distributionManagement>
        <repository>
            <id>ZT</id>
            <name>中铜 ZStack 私服</name>
            <url>http://172.16.46.63:30708/repository/test/</url>
        </repository>
        <snapshotRepository>
            <id>ZT-snap</id>
            <name>中铜 ZStack 私服</name>
            <url>http://172.16.46.63:30708/repository/test-snap/</url>
        </snapshotRepository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>env-dev</id>
            <properties>
                <env.name>dev</env.name>
                <!--Nacos 配置-->
                <config.server-addr>172.16.46.63:30848</config.server-addr>
                <config.namespace>dev</config.namespace>
                <config.group>DEFAULT_GROUP</config.group>
                <config.username>nacos</config.username>
                <config.password>P@ssword25</config.password>
                <config.version>1.0.0</config.version>
            </properties>
        </profile>
        <profile>
            <id>env-prod</id>
            <properties>
                <env.name>prod</env.name>
                <!--Nacos 配置-->
                <config.server-addr>172.16.46.63:30848</config.server-addr>
                <config.namespace>prod</config.namespace>
                <config.group>DEFAULT_GROUP</config.group>
                <config.username>nacos</config.username>
                <config.password>P@ssword25</config.password>
                <config.version>1.0.0</config.version>
            </properties>
        </profile>
        <profile>
            <id>env-local</id>
            <properties>
                <env.name>local</env.name>
<!--                <config.server-addr>localhost:8848</config.server-addr>-->
                <config.server-addr>172.16.46.63:30848</config.server-addr>
                <config.namespace>local</config.namespace>
                <config.group>DEFAULT_GROUP</config.group>
                <config.username>nacos</config.username>
                <config.password>P@ssword25</config.password>
                <config.version>1.0.0</config.version>
            </properties>
        </profile>
        <profile>
            <id>chenbowen</id>
            <properties>
                <config.namespace>chenbowen</config.namespace>
            </properties>
        </profile>
    </profiles>

</project>
