<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.6.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.github.ice-zero-cat</groupId>
    <artifactId>framework</artifactId>
    <version>0.0.2</version>
    <packaging>pom</packaging>
    <name>framework</name>
    <description>Dao framework</description>

    <modules>
        <module>admin</module>
        <module>jpa</module>
        <module>core</module>
        <module>jdbc-template</module>
        <module>backup</module>
        <module>icezerocat-mybatismp</module>
    </modules>

    <!--版本号管理-->
    <properties>
        <!--上传到中央仓库的插件工具-->
        <maven-scm-plugin.version>1.8.1</maven-scm-plugin.version>
        <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.7</nexus-staging-maven-plugin.version>
        <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
        <maven-javadoc-plugin.version>2.9.1</maven-javadoc-plugin.version>
        <maven-source-plugin.version>2.2.1</maven-source-plugin.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <!--多模块处理-->
        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>

        <!--模块依赖-->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <jpa.version>0.0.2</jpa.version>
        <reflectasm.version>1.11.9</reflectasm.version>
        <core.version>0.0.2</core.version>
        <guava.version>29.0-jre</guava.version>
        <fastjson.version>1.2.49</fastjson.version>
        <jdbc-template.version>0.0.2</jdbc-template.version>
        <backup.version>0.0.2</backup.version>
        <admin.version>0.0.2</admin.version>
        <icezerocat-mybatismp.version>0.0.2</icezerocat-mybatismp.version>
    </properties>

    <!--全局依赖-->
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <!--jpa封装-->
            <dependency>
                <groupId>github.com.ice-zero-cat</groupId>
                <artifactId>jpa</artifactId>
                <version>${jpa.version}</version>
            </dependency>
            <!--jdbcTemplate封装-->
            <dependency>
                <groupId>github.com.ice-zero-cat</groupId>
                <artifactId>jdbc-template</artifactId>
                <version>${jdbc-template.version}</version>
            </dependency>
            <!-- core -->
            <dependency>
                <groupId>github.com.ice-zero-cat</groupId>
                <artifactId>core</artifactId>
                <version>${core.version}</version>
            </dependency>
            <!-- icezerocat-mybatismp -->
            <dependency>
                <groupId>com.github.ice-zero-cat</groupId>
                <artifactId>icezerocat-mybatismp</artifactId>
                <version>${icezerocat-mybatismp.version}</version>
            </dependency>
            <!-- 类构建反射reflectasm -->
            <dependency>
                <groupId>com.esotericsoftware</groupId>
                <artifactId>reflectasm</artifactId>
                <version>${reflectasm.version}</version>
            </dependency>
            <!-- guava -->
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>
            <!--    fastJson    -->
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>fastjson</artifactId>
                <version>${fastjson.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <!--+++++++++++++++++ maven中央仓库配置 ++++++++++++++++++-->
    <!--1、分布式管理部分-->
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
    <!--2、项目地址 -->
    <scm>
        <connection>scm:git:git@github.com:ice-zero-cat/framework.git</connection>
        <developerConnection>scm:git:git@github.com:ice-zero-cat/framework.git</developerConnection>
        <url>git@github.com:ice-zero-cat/framework.git</url>
    </scm>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
            </plugin>

            <!--<plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    &lt;!&ndash;fork :  如果没有该项配置，devtools不会起作用，即应用不会restart &ndash;&gt;
                    <fork>true</fork>
                </configuration>
            </plugin>-->

            <!--1、++++++++++++++++ 添加deploy插件、sonatype的staging插件、release插件 +++++++++++++++++-->
            <!--deploy插件-->
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${maven-deploy-plugin.version}</version>
                <executions>
                    <execution>
                        <id>default-deploy</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!--sonatype插件-->
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>${nexus-staging-maven-plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <!--scm插件-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-plugin</artifactId>
                <version>${maven-scm-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven-release-plugin.version}</version>
                <configuration>
                    <mavenExecutorId>forked-path</mavenExecutorId>
                    <useReleaseProfile>false</useReleaseProfile>
                    <arguments>-Psonatype-oss-release</arguments>
                    <pushChanges>false</pushChanges>
                    <localCheckout>false</localCheckout>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <!--排除一些目录文件不要发布-->
                    <checkModificationExcludes>
                        <checkModificationExclude>.idea/</checkModificationExclude>
                        <checkModificationExclude>.idea/*</checkModificationExclude>
                        <checkModificationExclude>.idea/libraries/*</checkModificationExclude>
                        <checkModificationExclude>pom.xml</checkModificationExclude>
                        <checkModificationExclude>framework.iml</checkModificationExclude>
                    </checkModificationExcludes>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-scm-plugin</artifactId>
                        <version>${maven-scm-plugin.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!--2、Javadoc和Source jar文件，配置javadoc和源Maven插件-->
            <!-- Source -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!--javadoc-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <aggregate>true</aggregate>
                    <charset>UTF-8</charset>
                    <encoding>UTF-8</encoding>
                    <docencoding>UTF-8</docencoding>
                    <!-- 临时解决不规范的javadoc生成报错,后面要规范化后把这行去掉 -->
                    <!--<additionalparam>-Xdoclint:none</additionalparam>-->
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!--3、GPG签名加密-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>${maven-gpg-plugin.version}</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
