<?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>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.1.RELEASE</version>
    </parent>

    <groupId>com.github.myoss</groupId>
    <artifactId>phoenix-parent</artifactId>
    <version>1.1.2.RELEASE</version>
    <packaging>pom</packaging>

    <name>phoenix-parent</name>
    <description>myoss open source project, phoenix parent written in Java</description>
    <url>https://github.com/myoss/phoenix-parent</url>
    <inceptionYear>2018</inceptionYear>

    <scm>
        <url>https://github.com/myoss/phoenix-parent</url>
        <connection>scm:git:https://github.com/myoss/phoenix-parent.git</connection>
    </scm>

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

    <developers>
        <developer>
            <name>Jerry.Chen</name>
            <email>jerry.myoss@gmail.com</email>
            <organizationUrl>https://github.com/myoss</organizationUrl>
        </developer>
    </developers>

    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>

        <!-- myoss cloud -->
        <code-format-checkstyle.version>1.0.0.RELEASE</code-format-checkstyle.version>
        <!-- myoss cloud -->

        <!-- third party -->
        <puppycrawl-tools-checkstyle.version>8.10</puppycrawl-tools-checkstyle.version>
        <spring-javaformat-checkstyle.version>0.0.5</spring-javaformat-checkstyle.version>
        <!-- third party -->
    </properties>

    <dependencies>
        <!-- spring boot start -->
        <dependency>
            <!--
                support to generate spring-configuration-metadata.json when package jar,
                generate your own configuration meta-data file from items annotated with @ConfigurationProperties
             -->
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
        <!-- spring boot end -->

        <!-- spring cloud dependency start -->
        <!-- spring cloud dependency end -->

        <!-- utils start -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
        <!-- utils end -->

        <!-- test start -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <optional>true</optional>
        </dependency>
        <!-- test end -->
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Finchley.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <!-- generate sources code attachments -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!-- generate javadoc attachments -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-javadoc</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <charset>UTF-8</charset>
                    <encoding>UTF-8</encoding>
                    <docencoding>UTF-8</docencoding>
                    <failOnError>true</failOnError>
                </configuration>
            </plugin>
            <plugin>
                <!-- GPG Signed Components -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!-- 检查代码格式 -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.0.0</version>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>${puppycrawl-tools-checkstyle.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>com.github.myoss.checkstyle</groupId>
                        <artifactId>code-format-checkstyle</artifactId>
                        <version>${code-format-checkstyle.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>io.spring.javaformat</groupId>
                        <artifactId>spring-javaformat-checkstyle</artifactId>
                        <version>${spring-javaformat-checkstyle.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>checkstyle-validation</id>
                        <phase>validate</phase>
                        <configuration>
                            <skip>${disable.checks}</skip>
                            <configLocation>checkstyle/checkstyle.xml</configLocation>
                            <suppressionsLocation>checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
                            <headerLocation>checkstyle/checkstyle-header.txt</headerLocation>
                            <encoding>UTF-8</encoding>
                            <consoleOutput>true</consoleOutput>
                            <failsOnError>true</failsOnError>
                            <includeTestSourceDirectory>true</includeTestSourceDirectory>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>oss-nexus-auto-releases</id>
            <build>
                <plugins>
                    <plugin>
                        <!-- Nexus Staging Plugin, auto deploy close and release -->
                        <!-- 该插件允许你方便的将组件发布到Maven中央仓库, 而不需要登录OSSRH网站自己去Close然后又Release -->
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>nexus-releases</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>