<?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">
    <parent>
        <groupId>cn.itlym.platform</groupId>
        <artifactId>shoulder-platform-common</artifactId>
        <version>1.0-SNAPSHOT</version><!-- shoulder-platform-version -->
        <relativePath>../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>shoulder-platform-parent</artifactId>
    <packaging>pom</packaging>

    <url>https://github.com/ChinaLym/shoulder-platform</url>
    <properties>
        <java.version>17</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.javadoc.charset>${project.build.sourceEncoding}</maven.javadoc.charset>
        <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>

        <!-- =============== Shoulder 版本 =============== -->

        <shoulder.version>0.8-SNAPSHOT</shoulder.version><!-- shoulder-version -->
        <shoulder-platform.version>1.0-SNAPSHOT</shoulder-platform.version><!-- shoulder-platform-version -->

        <shoulder-sms-aliyun.version>1.0-SNAPSHOT</shoulder-sms-aliyun.version><!-- shoulder-sms-aliyun.version -->

        <!-- =============== 第三方依赖版本 =============== -->
        <!-- alibaba 2.2.3 -> cloud hoxton.SR8 -> boot 2.3.3.RELEASE -->

        <!--spring-cloud-alibaba-dependencies -->
        <spring-cloud-alibaba.version>2023.0.0.0-RC1</spring-cloud-alibaba.version>
<!--        todo 2.3.2-->
        <nacos.client.version>1.3.2</nacos.client.version>

        <!--spring-cloud-alibaba引入了 fastJson，而低版本的 fastJson 太多安全漏洞，故这里统一设置为高版本 todo 2.0.49 fastjson2 -->
        <fastjson.version>1.2.73</fastjson.version>

        <minio.version>7.0.2</minio.version>

        <!--监控-->
        <spring-boot-admin-starter-client.version>2.3.0</spring-boot-admin-starter-client.version>
        <micrometer-registry-prometheus.version>2.3.0</micrometer-registry-prometheus.version>


        <!-- =============== 插件版本 =============== -->

        <maven-resources-plugin.version>3.2.0</maven-resources-plugin.version>
        <dockerfile-maven-plugin.version>1.4.19</dockerfile-maven-plugin.version>
        <docker.image.prefix>shoulder</docker.image.prefix>
        <spring-boot-maven-plugin.version>3.0.2</spring-boot-maven-plugin.version><!-- spring-boot.version -->

        <maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
        <maven-source-plugin.version>3.3.0</maven-source-plugin.version>
        <maven-javadoc-plugin.version>3.6.0</maven-javadoc-plugin.version>
        <maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
        <maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>

        <maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
        <findbugs-maven-plugin.version>3.0.5</findbugs-maven-plugin.version>
        <cobertura-maven-plugin.version>2.7</cobertura-maven-plugin.version>
        <versions-maven-plugin.version>2.7</versions-maven-plugin.version>
        <license-maven-plugin.version>2.2.0</license-maven-plugin.version>
        <git-commit-id-plugin.version>6.0.0</git-commit-id-plugin.version>
        <sonar-maven-plugin.version>3.10.0.2594</sonar-maven-plugin.version>

        <shoulder-maven-plugin.version>1.1</shoulder-maven-plugin.version>
        <shoulder-framework.errcode-prefix>0x0000</shoulder-framework.errcode-prefix>

        <springdoc-openapi-maven-plugin.version>0.3</springdoc-openapi-maven-plugin.version>

    </properties>

    <name>${project.artifactId}</name>
    <description>shoulder platform 的通用父类，管理了平台的技术选型和通用配置</description>
    <developers>
        <developer>
            <name>lym</name>
            <email>cn_lym@foxmail.com</email>
        </developer>
    </developers>
    <licenses>
        <license>
            <name>Apache 2</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <dependencyManagement>
        <dependencies>

            <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>
            <dependency>
                <groupId>cn.itlym</groupId>
                <artifactId>shoulder-parent</artifactId>
                <version>${shoulder.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- 平台提供的选型 -->
            <dependency>
                <groupId>cn.itlym.platform</groupId>
                <artifactId>shoulder-platform-starter-config-client</artifactId>
                <version>${shoulder-platform.version}</version>
            </dependency>
            <dependency>
                <groupId>cn.itlym.platform</groupId>
                <artifactId>shoulder-platform-starter-db</artifactId>
                <version>${shoulder-platform.version}</version>
            </dependency>
            <dependency>
                <groupId>cn.itlym.platform</groupId>
                <artifactId>shoulder-platform-starter-discovery-client</artifactId>
                <version>${shoulder-platform.version}</version>
            </dependency>
            <dependency>
                <groupId>cn.itlym.platform</groupId>
                <artifactId>shoulder-platform-starter-job</artifactId>
                <version>${shoulder-platform.version}</version>
            </dependency>
            <dependency>
                <groupId>cn.itlym.platform</groupId>
                <artifactId>shoulder-platform-starter-rpc-client</artifactId>
                <version>${shoulder-platform.version}</version>
            </dependency>
            <dependency>
                <groupId>cn.itlym.platform</groupId>
                <artifactId>shoulder-platform-starter-rpc-server</artifactId>
                <version>${shoulder-platform.version}</version>
            </dependency>
            <dependency>
                <groupId>cn.itlym.platform</groupId>
                <artifactId>shoulder-platform-starter-monitor</artifactId>
                <version>${shoulder-platform.version}</version>
            </dependency>
            <dependency>
                <groupId>cn.itlym.platform</groupId>
                <artifactId>shoulder-platform-starter-mq</artifactId>
                <version>${shoulder-platform.version}</version>
            </dependency>
            <dependency>
                <groupId>cn.itlym.platform</groupId>
                <artifactId>shoulder-platform-starter-trace</artifactId>
                <version>${shoulder-platform.version}</version>
            </dependency>

            <dependency>
                <groupId>cn.itlym.platform</groupId>
                <artifactId>shoulder-platform-starter-micro</artifactId>
                <version>${shoulder-platform.version}</version>
            </dependency>

            <dependency>
                <groupId>cn.itlym.platform</groupId>
                <artifactId>shoulder-sms-aliyun-spring-boot-starter</artifactId>
                <version>${shoulder-sms-aliyun.version}</version>
            </dependency>

            <!-- =============================================  -->

            <!-- 升级阿里巴巴中间件包间接引入的低版本 FastJson 等，使用更安全的版本，强烈建议代码不要用 FastJson -->
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>fastjson</artifactId>
                <version>${fastjson.version}</version>
            </dependency>
            <!-- https://mvnrepository.com/artifact/com.alibaba.fastjson2/fastjson2 -->
            <dependency>
                <groupId>com.alibaba.fastjson2</groupId>
                <artifactId>fastjson2</artifactId>
                <version>${fastjson.version}</version>
            </dependency>


            <!--<dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
            </dependency>-->

            <dependency>
                <groupId>com.alibaba.nacos</groupId>
                <artifactId>nacos-client</artifactId>
                <version>${nacos.client.version}</version>
            </dependency>

            <dependency>
                <groupId>de.codecentric</groupId>
                <artifactId>spring-boot-admin-starter-client</artifactId>
                <version>${spring-boot-admin-starter-client.version}</version>
            </dependency>

            <dependency>
                <groupId>io.micrometer</groupId>
                <artifactId>micrometer-registry-prometheus</artifactId>
                <version>${micrometer-registry-prometheus.version}</version>
            </dependency>

            <dependency>
                <groupId>io.minio</groupId>
                <artifactId>minio</artifactId>
                <version>${minio.version}</version>
            </dependency>

            <!-- log-trace begin -->
            <!--<dependency>
                <groupId>io.zipkin.brave</groupId>
                <artifactId>brave</artifactId>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>io.zipkin.brave</groupId>
                <artifactId>brave-instrumentation-http</artifactId>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>io.zipkin.brave</groupId>
                <artifactId>brave-instrumentation-servlet</artifactId>
                <version>${brave.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>io.zipkin.brave</groupId>
                <artifactId>brave-context-slf4j</artifactId>
                <version>${brave.version}</version>
            </dependency>-->
            <!-- log-trace end -->

        </dependencies>
    </dependencyManagement>

    <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>
                <filtering>true</filtering>
            </resource>
        </resources>-->

        <pluginManagement>
            <plugins>

                <!-- resources资源插件 -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven-resources-plugin.version}</version>
                    <configuration>
                        <!-- 将默认的 '${*}' 和 '@' 改为 '@' -->
                        <useDefaultDelimiters>false</useDefaultDelimiters>
                        <delimiters>
                            <delimiter>@</delimiter>
                        </delimiters>
                        <!-- 统一项目文件字符集编码-资源文件 -->
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <!-- 打包时忽略证书文件 -->
                        <nonFilteredFileExtensions>
                            <nonFilteredFileExtension>pem</nonFilteredFileExtension>
                            <nonFilteredFileExtension>pfx</nonFilteredFileExtension>
                            <nonFilteredFileExtension>p12</nonFilteredFileExtension>
                            <nonFilteredFileExtension>key</nonFilteredFileExtension>
                        </nonFilteredFileExtensions>
                    </configuration>
                </plugin>

                <!-- Spring Boot maven 打包插件 -->
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <version>${spring-boot-maven-plugin.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>repackage</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <!-- docker打包插件 -->
                <plugin>
                    <groupId>com.spotify</groupId>
                    <artifactId>dockerfile-maven-plugin</artifactId>
                    <version>${dockerfile-maven-plugin.version}</version>
                    <configuration>
                        <repository>${docker.image.prefix}/${project.artifactId}</repository>
                        <tag>${shoulder-platform.version}</tag>
                        <buildArgs>
                            <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
                        </buildArgs>
                    </configuration>
                </plugin>


                <!-- war 方式打包插件 -->
                <!--<plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>${maven-war-plugin}</version>2.1.1
                    <configuration>
                        &lt;!&ndash; 设置 war 名称 和编码方式 &ndash;&gt;
                        <warName>${project.artifactId}</warName>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>-->

            </plugins>
        </pluginManagement>
    </build>

</project>