<?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.persagy</groupId>
    <artifactId>dmp-parent</artifactId>
    <version>1.0.0</version>
    <packaging>pom</packaging>

    <repositories>
        <repository>
            <id>integrated</id>
            <name>releases Repository</name>
            <url>http://47.93.132.139:8081/nexus/content/repositories/integrated/</url>
        </repository>
    </repositories>
    <distributionManagement>
        <repository>
            <id>persagy</id>
            <name>releases Repository</name>
            <url>http://47.93.132.139:8081/nexus/content/repositories/persagy/</url>
            <layout>default</layout>
        </repository>
    </distributionManagement>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.14.RELEASE</version>
        <relativePath/>
    </parent>
    <!-- 版本管理 -->
    <properties>
        <dmp.version>1.0.0</dmp.version>
        <platform.version>1.0.0</platform.version>
        <mybatis-plus.version>3.3.1</mybatis-plus.version>
        <dynamic-datasource.version>3.3.2</dynamic-datasource.version>
        <tomcat-jdbc.version>9.0.31</tomcat-jdbc.version>
        <HikariCP.version>3.2.0</HikariCP.version>
        <mysql.version>8.0.15</mysql.version>
        <guava.version>30.0-jre</guava.version>
        <spring.version>5.1.15.RELEASE</spring.version>
        <spring-cloud-dependencies.version>Greenwich.SR6</spring-cloud-dependencies.version>
        <spring-data.version>2.1.17.RELEASE</spring-data.version>
        <spring-data-jpa.version>2.0.11.RELEASE</spring-data-jpa.version>
        <mapstruct.version>1.2.0.Final</mapstruct.version>
        <lang.version>2.5</lang.version>
        <gson.version>2.8.6</gson.version>
        <fastjson.version>1.2.47</fastjson.version>
        <druid.version>1.1.22</druid.version>
        <hutool.version>5.5.8</hutool.version>
        <!-- Minio -->
        <minio.version>8.3.0</minio.version>
        <okhttp.version>4.8.1</okhttp.version>
        <kotlin.version>1.3.70</kotlin.version>
        <!-- Plugins -->
        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
        <spring-boot-maven-plugin.version>2.4.3</spring-boot-maven-plugin.version>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
        <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
        <maven-resources-plugin.version>3.0.2</maven-resources-plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.persagy</groupId>
                <artifactId>dmp-common</artifactId>
                <version>${dmp.version}</version>
            </dependency>
            <dependency>
                <groupId>com.persagy</groupId>
                <artifactId>dmp-server</artifactId>
                <version>${dmp.version}</version>
            </dependency>
            <dependency>
                <groupId>com.persagy</groupId>
                <artifactId>dmp-mybatis</artifactId>
                <version>${dmp.version}</version>
            </dependency>
            <dependency>
                <groupId>com.persagy</groupId>
                <artifactId>dmp-file-starter</artifactId>
                <version>${dmp.version}</version>
            </dependency>
            <dependency>
                <groupId>com.persagy</groupId>
                <artifactId>dmp-amqp-starter</artifactId>
                <version>${dmp.version}</version>
            </dependency>
            <dependency>
                <groupId>com.persagy</groupId>
                <artifactId>dmp-digital-starter</artifactId>
                <version>${dmp.version}</version>
            </dependency>
            <dependency>
                <groupId>com.persagy</groupId>
                <artifactId>integrated-common-core</artifactId>
                <version>${platform.version}</version>
            </dependency>
            <dependency>
                <groupId>com.persagy</groupId>
                <artifactId>integrated-common-security</artifactId>
                <version>${platform.version}</version>
            </dependency>
            <dependency>
                <groupId>com.persagy</groupId>
                <artifactId>integrated-log-spring-boot-starter</artifactId>
                <version>${platform.version}</version>
            </dependency>
            <dependency>
                <groupId>com.persagy</groupId>
                <artifactId>integrated-ribbon-spring-boot-starter</artifactId>
                <version>${platform.version}</version>
            </dependency>
            <dependency>
                <groupId>com.persagy</groupId>
                <artifactId>integrated-swagger2-spring-boot-starter</artifactId>
                <version>${platform.version}</version>
            </dependency>
            <dependency>
                <groupId>com.persagy</groupId>
                <artifactId>integrated-redis-spring-boot-starter</artifactId>
                <version>${platform.version}</version>
            </dependency>
            <dependency>
                <groupId>com.persagy</groupId>
                <artifactId>integrated-config-client</artifactId>
                <version>${platform.version}</version>
            </dependency>
            <!-- mybatis plus -->
            <dependency>
                <groupId>com.baomidou</groupId>
                <artifactId>mybatis-plus-boot-starter</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>mybatis-plus-extension</artifactId>
                <version>${mybatis-plus.version}</version>
            </dependency>
            <dependency>
                <groupId>com.baomidou</groupId>
                <artifactId>dynamic-datasource-spring-boot-starter</artifactId>
                <version>${dynamic-datasource.version}</version>
            </dependency>
            <!-- mapstruct 优雅的进行bean与dto的转换 -->
            <dependency>
                <groupId>org.mapstruct</groupId>
                <artifactId>mapstruct-jdk8</artifactId>
                <version>${mapstruct.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mapstruct</groupId>
                <artifactId>mapstruct-processor</artifactId>
                <version>${mapstruct.version}</version>
            </dependency>
            <!-- alibaba druid -->
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>druid-spring-boot-starter</artifactId>
                <version>${druid.version}</version>
            </dependency>
            <!-- 以下是数据库连接池版本管理，建议使用provided方式引入-->
            <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-jdbc</artifactId>
                <version>${tomcat-jdbc.version}</version>
            </dependency>
            <dependency>
                <groupId>com.zaxxer</groupId>
                <artifactId>HikariCP</artifactId>
                <version>${HikariCP.version}</version>
            </dependency>
            <!-- 以下是数据库driver版本管理，建议使用provided方式引入 -->
            <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>${mysql.version}</version>
            </dependency>
            <!-- 以下是commons工具版本管理 -->
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>
            <!-- 以下是springCloud版本管理 -->
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud-dependencies.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- 以下是spring版本管理 -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-web</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-tx</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-aop</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-test</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-beans</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-webmvc</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context-support</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-expression</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-jcl</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-jdbc</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-messaging</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-oxm</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-webflux</artifactId>
                <version>${spring.version}</version>
            </dependency>
            <!-- 以下是spring data版本管理 -->
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-commons</artifactId>
                <version>${spring-data.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-redis</artifactId>
                <version>${spring-data.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-jpa</artifactId>
                <version>${spring-data-jpa.version}</version>
            </dependency>
            <!-- hutool -->
            <dependency>
                <groupId>cn.hutool</groupId>
                <artifactId>hutool-all</artifactId>
                <version>${hutool.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-lang</groupId>
                <artifactId>commons-lang</artifactId>
                <version>${lang.version}</version>
            </dependency>
            <!-- gson json，java对象互转 -->
            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>${gson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>fastjson</artifactId>
                <version>${fastjson.version}</version>
            </dependency>
            <!-- Minio -->
            <dependency>
                <groupId>io.minio</groupId>
                <artifactId>minio</artifactId>
                <version>${minio.version}</version>
            </dependency>
            <dependency>
                <groupId>com.squareup.okhttp3</groupId>
                <artifactId>okhttp</artifactId>
                <version>${okhttp.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib-common</artifactId>
                <version>${kotlin.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <!-- 插件配置 -->
    <build>
        <finalName>${project.artifactId}</finalName>
        <pluginManagement>
            <plugins>
                <!-- compiler插件, 设定JDK版本 -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                        <encoding>UTF-8</encoding>
                        <skip>true</skip>
                        <showWarnings>true</showWarnings>
                    </configuration>
                </plugin>
                <!-- 不执行单元测试，但会编译测试类并在target/test-classes目录下生成相应的class -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                    <configuration>
                        <skipTests>true</skipTests>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <version>${spring-boot-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</version>
                    <configuration>
                        <attach>true</attach>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>compile</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!-- resource插件 -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven-resources-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>copy-resources</id>
                            <phase>package</phase>
                            <goals>
                                <goal>copy-resources</goal>
                            </goals>
                            <configuration>
                                <resources>
                                    <resource>
                                        <directory>src/main/resources/</directory>
                                        <includes>
                                            <include>**/*.yml</include>
                                        </includes>
                                    </resource>
                                    <resource>
                                        <directory>${project.build.directory}</directory>
                                        <includes>
                                            <include>**/version.txt</include>
                                        </includes>
                                    </resource>
                                </resources>
                                <outputDirectory>${project.build.directory}/config</outputDirectory>
                            </configuration>
                        </execution>
                        <!--拷贝启动脚本-->
                        <execution>
                            <id>copy-version</id>
                            <phase>package</phase>
                            <goals>
                                <goal>copy-resources</goal>
                            </goals>
                            <configuration>
                                <resources>
                                    <resource>
                                        <directory>src/script</directory>
                                    </resource>
                                </resources>
                                <outputDirectory>${project.build.directory}</outputDirectory>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>