<?xml version="1.0" encoding="UTF-8"?>

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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.kxs</groupId>
    <artifactId>kxs-cloud</artifactId>
    <name>${project.artifactId}</name>
    <version>1.1.0</version>
    <packaging>pom</packaging>

    <properties>
        <spring-boot.version>3.1.5</spring-boot.version>
        <spring-cloud.version>2022.0.4</spring-cloud.version>
        <spring-cloud-alibaba.version>2022.0.0.0</spring-cloud-alibaba.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <captcha.version>2.2.3</captcha.version>
        <jasypt.version>3.0.5</jasypt.version>
        <jaxb.version>2.3.5</jaxb.version>
        <spring.authorization.version>1.1.2</spring.authorization.version>
        <swagger.fox.version>3.0.0</swagger.fox.version>
        <springdoc.version>2.2.0</springdoc.version>
        <swagger.core.version>2.2.14</swagger.core.version>
        <git.commit.plugin>6.0.0</git.commit.plugin>
        <spring.checkstyle.plugin>0.0.39</spring.checkstyle.plugin>
        <maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
        <log4j2.version>2.17.1</log4j2.version>
        <fastjson.version>1.2.83</fastjson.version>
        <excel.version>3.1.0</excel.version>
        <hutool.version>5.8.21</hutool.version>
        <mybatis-plus.version>3.5.3.2</mybatis-plus.version>
        <mysql.version>8.0.33</mysql.version>
        <dynamic-ds.version>4.1.3</dynamic-ds.version>
        <kxs.common.version>${project.version}</kxs.common.version>
        <knife4j.version>4.3.0</knife4j.version>
        <fastjson.version>1.2.83</fastjson.version>
        <oss.version>3.15.1</oss.version>
        <rocketmq.version>2.2.3</rocketmq.version>
    </properties>

    <!-- 以下依赖 全局所有的模块都会引入  -->
    <dependencies>
        <!--配置文件处理器-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-webflux</artifactId>
        </dependency>
        <!--Lombok-->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- JAVA 17 -->
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>${jaxb.version}</version>
        </dependency>
        <!--测试依赖-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <modules>
        <module>kxs-common</module>
        <module>kxs-system</module>
        <module>kxs-gateway</module>
        <module>kxs-quartz</module>
        <module>kxs-user</module>
        <module>kxs-store</module>
        <module>kxs-product</module>
        <module>kxs-visual</module>
        <module>kxs-transfer</module>
        <module>kxs-stat</module>
    </modules>

    <dependencyManagement>
        <dependencies>

            <!-- spring boot 依赖 -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- spring cloud 依赖 -->
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- spring cloud alibaba 依赖 -->
            <dependency>
                <groupId>com.alibaba.cloud</groupId>
                <artifactId>spring-cloud-alibaba-dependencies</artifactId>
                <version>${spring-cloud-alibaba.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!--web 模块-->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
                <version>${spring-boot.version}</version>
                <exclusions>
                    <!--排除tomcat依赖-->
                    <exclusion>
                        <artifactId>spring-boot-starter-tomcat</artifactId>
                        <groupId>org.springframework.boot</groupId>
                    </exclusion>
                </exclusions>
            </dependency>
            <!--hutool bom 工具类-->
            <dependency>
                <groupId>cn.hutool</groupId>
                <artifactId>hutool-bom</artifactId>
                <version>${hutool.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>org.yaml</groupId>
                <artifactId>snakeyaml</artifactId>
                <version>2.0</version>
            </dependency>

            <!--kxs 公共版本定义-->
            <dependency>
                <groupId>com.kxs</groupId>
                <artifactId>kxs-common-core</artifactId>
                <version>${kxs.common.version}</version>
            </dependency>
            <!--kxs 异步日志-->
            <dependency>
                <groupId>com.kxs</groupId>
                <artifactId>kxs-common-log</artifactId>
                <version>${kxs.common.version}</version>
            </dependency>

            <!--springdoc -->
            <dependency>
                <groupId>com.github.xiaoymin</groupId>
                <artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
                <version>${knife4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springdoc</groupId>
                <artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
                <version>${springdoc.version}</version>
            </dependency>
            <dependency>
                <groupId>io.swagger.core.v3</groupId>
                <artifactId>swagger-annotations-jakarta</artifactId>
                <version>${swagger.core.version}</version>
            </dependency>
            <!--orm 相关-->
            <dependency>
                <groupId>com.baomidou</groupId>
                <artifactId>mybatis-plus-boot-starter</artifactId>
                <version>${mybatis-plus.version}</version>
            </dependency>
            <dependency>
                <groupId>com.mysql</groupId>
                <artifactId>mysql-connector-j</artifactId>
                <version>${mysql.version}</version>
            </dependency>
            <dependency>
                <groupId>com.baomidou</groupId>
                <artifactId>mybatis-plus-extension</artifactId>
                <version>${mybatis-plus.version}</version>
            </dependency>
            <dependency>
                <groupId>com.baomidou</groupId>
                <artifactId>mybatis-plus-annotation</artifactId>
                <version>${mybatis-plus.version}</version>
            </dependency>

            <!-- 多数据源依赖 -->
            <dependency>
                <groupId>com.baomidou</groupId>
                <artifactId>dynamic-datasource-spring-boot3-starter</artifactId>
                <version>${dynamic-ds.version}</version>
            </dependency>
            <!-- excel 导入导出 -->
            <dependency>
                <groupId>com.pig4cloud.excel</groupId>
                <artifactId>excel-spring-boot-starter</artifactId>
                <version>${excel.version}</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>fastjson</artifactId>
                <version>${fastjson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.aliyun.oss</groupId>
                <artifactId>aliyun-sdk-oss</artifactId>
                <version>${oss.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.rocketmq</groupId>
                <artifactId>rocketmq-spring-boot-starter</artifactId>
                <version>${rocketmq.version}</version>
            </dependency>
            <!-- 鉴权 -->
            <dependency>
                <groupId>com.kxs</groupId>
                <artifactId>kxs-common-security</artifactId>
                <version>${project.version}</version>
            </dependency>
            <!-- API文档 -->
            <dependency>
                <groupId>com.kxs</groupId>
                <artifactId>kxs-common-swagger</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.kxs</groupId>
                <artifactId>kxs-common-mybatis</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.kxs</groupId>
                <artifactId>kxs-common-idempotent</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.kxs</groupId>
                <artifactId>kxs-common-seata</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.kxs</groupId>
                <artifactId>kxs-common-oss</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.kxs</groupId>
                <artifactId>kxs-common-mq</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.kxs</groupId>
                <artifactId>kxs-common-pay</artifactId>
                <version>${project.version}</version>
            </dependency>



            <!-- 系统管理模块 -->
            <dependency>
                <groupId>com.kxs</groupId>
                <artifactId>kxs-system-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <!-- 用户管理模块 -->
            <dependency>
                <groupId>com.kxs</groupId>
                <artifactId>kxs-user-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <!-- 仓库管理模块 -->
            <dependency>
                <groupId>com.kxs</groupId>
                <artifactId>kxs-store-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <!-- 产品管理模块 -->
            <dependency>
                <groupId>com.kxs</groupId>
                <artifactId>kxs-product-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <!-- 统计模块 -->
            <dependency>
                <groupId>com.kxs</groupId>
                <artifactId>kxs-stat-api</artifactId>
                <version>${project.version}</version>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <build>
        <finalName>${project.name}</finalName>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <version>${spring-boot.version}</version>
                    <configuration>
                        <finalName>${project.build.finalName}</finalName>
                        <layers>
                            <enabled>true</enabled>
                        </layers>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>repackage</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <debug>false</debug>
                    <compilerArgs>
                        <arg>-parameters</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <!--打包jar 与git commit 关联插件-->
            <plugin>
                <groupId>io.github.git-commit-id</groupId>
                <artifactId>git-commit-id-maven-plugin</artifactId>
                <version>${git.commit.plugin}</version>
                <executions>
                    <execution>
                        <id>get-the-git-infos</id>
                        <phase>initialize</phase>
                    </execution>
                </executions>
                <configuration>
                    <failOnNoGitDirectory>false</failOnNoGitDirectory>
                    <generateGitPropertiesFile>true</generateGitPropertiesFile>
                    <!--因为项目定制了jackson的日期时间序列化/反序列化格式，因此这里要进行配置,不然通过management.info.git.mode=full进行完整git信息监控时会存在问题-->
                    <dateFormat>yyyy-MM-dd HH:mm:ss</dateFormat>
                    <includeOnlyProperties>
                        <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
                        <includeOnlyProperty>^git.commit.(id|message|time).*$</includeOnlyProperty>
                    </includeOnlyProperties>
                </configuration>
            </plugin>
            <!--
            	代码格式插件，默认使用spring 规则，可运行命令进行项目格式化：./mvnw spring-javaformat:apply 或 mvn spring-javaformat:apply，可在IDEA中安装插件以下插件进行自动格式化：
            	https://repo1.maven.org/maven2/io/spring/javaformat/spring-javaformat-intellij-idea-plugin
            -->
            <plugin>
                <groupId>io.spring.javaformat</groupId>
                <artifactId>spring-javaformat-maven-plugin</artifactId>
                <version>${spring.checkstyle.plugin}</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <inherited>true</inherited>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>dev</id>
            <properties>
                <!-- 环境标识，需要与配置文件的名称相对应 -->
                <profiles.active>dev</profiles.active>
                <nacos.username>nacos</nacos.username>
                <nacos.password>nacos</nacos.password>
            </properties>
            <activation>
                <!-- 默认环境 -->
                <activeByDefault>true</activeByDefault>
            </activation>
        </profile>
        <profile>
            <id>test</id>
            <properties>
                <!-- 环境标识，需要与配置文件的名称相对应 -->
                <profiles.active>test</profiles.active>
                <nacos.username>nacos</nacos.username>
                <nacos.password>nacos</nacos.password>
            </properties>
            <activation>
                <!-- 默认环境 -->
                <activeByDefault>false</activeByDefault>
            </activation>
        </profile>
        <profile>
            <id>prod</id>
            <properties>
                <!-- 环境标识，需要与配置文件的名称相对应 -->
                <profiles.active>prod</profiles.active>
                <nacos.username>nacos</nacos.username>
                <nacos.password>nacos</nacos.password>
            </properties>
            <activation>
                <!-- 默认环境 -->
                <activeByDefault>false</activeByDefault>
            </activation>
        </profile>
    </profiles>



</project>
