<?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>
    <groupId>cn.kevinkda</groupId>
    <artifactId>java-utils</artifactId>
    <version>0.0.1-RELEASE</version>

    <name>java-utils</name>
    <description>Demo project for Spring Boot</description>
    <url>https://github.com/kevinkda/maven-open-project</url>


    <organization>
        <url>https://github.com/kevinkda</url>
        <name>Kevin KDA</name>
    </organization>

    <inceptionYear>2020</inceptionYear>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>kevin</id>
            <name>Kevin Tang</name>
            <email>kevin_kda@yahoo.com.au</email>
            <organization>Kevin KDA</organization>
            <organizationUrl>https://github.com/kevinkda</organizationUrl>
            <timezone>UTC+08:00</timezone>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:kevinkda/maven-open-project.git</connection>
        <developerConnection>scm:git:scm:git:git@github.com:kevinkda/maven-open-project.git</developerConnection>
        <url>https://github.com/kevinkda/maven-open-project</url>
        <tag>java-utils-0.0.1</tag>
    </scm>

    <issueManagement>
        <system>Github</system>
        <url>https://github.com/kevinkda/maven-open-project/issues</url>
    </issueManagement>

    <ciManagement>
        <system>Travis</system>
        <url>https://travis-ci.org/dexecutor/dexecutor-core</url>
    </ciManagement>


    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <spring-boot.version>2.3.0.RELEASE</spring-boot.version>


        <maven.deploy.plugin.version>3.0.0-M1</maven.deploy.plugin.version>
        <maven.source.plugin.version>3.2.1</maven.source.plugin.version>
        <maven.javadoc.plugin.version>3.2.0</maven.javadoc.plugin.version>
        <maven.release.plugin.version>3.0.0-M1</maven.release.plugin.version>
        <maven.surefire.plugin.version>3.0.0-M5</maven.surefire.plugin.version>
        <maven.gpg.plugin.version>1.6</maven.gpg.plugin.version>
        <maven.compiler.plugin.version>3.8.1</maven.compiler.plugin.version>
        <maven.scm.provider.gitexe.version>1.11.2</maven.scm.provider.gitexe.version>

        <nexus.staging.maven.plugin.version>1.6.8</nexus.staging.maven.plugin.version>


        <mybatis-starter.version>2.1.2</mybatis-starter.version>

        <google.code.gson.version>[2.8.6,)</google.code.gson.version>

        <alibaba.druid.version>[1.1.21,)</alibaba.druid.version>
        <alibaba.fastjson.version>[1.2.68,)</alibaba.fastjson.version>
        <taobao.arthas.version>3.4.1</taobao.arthas.version>

        <java-utils.version>[3.1.2-SNAPSHOT,)</java-utils.version>

        <pagehelper.version>[1.2.5,)</pagehelper.version>

    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>${maven.deploy.plugin.version}</version>
        </dependency>

        <!--        <dependency>-->
        <!--            <groupId>org.mybatis.spring.boot</groupId>-->
        <!--            <artifactId>mybatis-spring-boot-starter</artifactId>-->
        <!--            <version>${mybatis-starter.version}</version>-->
        <!--        </dependency>-->

        <!--        <dependency>-->
        <!--            <groupId>mysql</groupId>-->
        <!--            <artifactId>mysql-connector-java</artifactId>-->
        <!--            <scope>runtime</scope>-->
        <!--        </dependency>-->

        <!--        <dependency>-->
        <!--            <groupId>com.alibaba</groupId>-->
        <!--            <artifactId>druid</artifactId>-->
        <!--            <version>${alibaba.druid.version}</version>-->
        <!--        </dependency>-->


    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <resources>
            <resource>
                <directory>${project.basedir}</directory>
                <includes>
                    <include>NOTICE*</include>
                    <include>LICENSE*</include>
                </includes>
            </resource>
        </resources>
        <plugins>
            <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>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${spring-boot.version}</version>
                <configuration>
                    <mainClass>com.kevinkda.core.util.JavaUtilsApplication</mainClass>
                </configuration>
                <executions>
                    <execution>
                        <id>repackage</id>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                        <phase>none</phase>
                    </execution>
                </executions>
            </plugin>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <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>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <!--                <version>2.5.3</version>-->
                <version>${maven.release.plugin.version}</version>
                <configuration>
                    <localCheckout>true</localCheckout>
                    <pushChanges>false</pushChanges>
                    <mavenExecutorId>forked-path</mavenExecutorId>
                    <arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-provider-gitexe</artifactId>
                        <version>${maven.scm.provider.gitexe.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <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>

            <!--            <plugin>-->
            <!--                <groupId>org.apache.maven.plugins</groupId>-->
            <!--                <artifactId>maven-source-plugin</artifactId>-->
            <!--                &lt;!&ndash;                <version>[2.10.4,)</version>&ndash;&gt;-->
            <!--                &lt;!&ndash;                <version>2.1.2</version>&ndash;&gt;-->
            <!--                <version>${maven.source.plugin.version}</version>-->
            <!--                <configuration>-->
            <!--                    <attach>true</attach>-->
            <!--                    &lt;!&ndash;                    <encoding>UTF-8</encoding>&ndash;&gt;-->
            <!--                </configuration>-->
            <!--                <executions>-->
            <!--                    <execution>-->
            <!--                        <id>attach-javadoc</id>-->
            <!--                        <goals>-->
            <!--                            <goal>jar</goal>-->
            <!--                        </goals>-->
            <!--                    </execution>-->
            <!--                    <execution>-->
            <!--                        <id>attach-sources</id>-->
            <!--                        <goals>-->
            <!--                            <goal>jar</goal>-->
            <!--                        </goals>-->
            <!--                    </execution>-->
            <!--                </executions>-->
            <!--            </plugin>-->

            <!-- Source -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven.source.plugin.version}</version>
                <executions>
                    <execution>
                        <phase>package</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>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.plugin.version}</version>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>


        </plugins>
    </build>


    <profiles>

        <!-- GPG Signature on release -->
<!--        <profile>-->
<!--            <id>release-sign-artifacts</id>-->
<!--            <activation>-->
<!--                <property>-->
<!--                    <name>performRelease</name>-->
<!--                    <value>true</value>-->
<!--                </property>-->
<!--            </activation>-->
<!--            <build>-->
<!--                <plugins>-->
<!--                    <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>-->
<!--        </profile>-->

        <profile>
            <!-- 这个id就是打包时的 -P 参数 -->
            <id>release</id>
            <build>
                <plugins>
                    <!-- Source插件-->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
<!--                        <version>2.2.1</version>-->
                        <version>${maven.source.plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>package</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>2.9.1</version>-->
                        <version>${maven.javadoc.plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <!-- -Xdoclint:none 是为了避免生成apidoc的时候检查过于严格而报错-->
<!--                                <configuration>-->
<!--                                    <additionalparam>-Xdoclint:none</additionalparam>-->
<!--                                </configuration>-->
                            </execution>
                        </executions>
                    </plugin>
                    <!-- GPG加密插件 -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
<!--                        <version>1.6</version>-->
                        <version>${maven.gpg.plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>

            <!-- snapshotRepository与repository的id应与setting.xml中添加的server的id一致 -->
            <distributionManagement>
                <snapshotRepository>
                    <id>sonatype-qinpiyi</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
                </snapshotRepository>
                <repository>
                    <id>sonatype-qinpiyi</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
        </profile>
    </profiles>

    <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>

</project>
