<?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.3.2.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <groupId>com.gitee.hpiot</groupId>
    <artifactId>hpiot-message</artifactId>
    <version>1.0.0</version>
    <packaging>pom</packaging>

    <properties>
        <build.sourceEncoding>UTF-8</build.sourceEncoding>
        <reporting.outputEncoding>UTF-8</reporting.outputEncoding>

        <java.version>1.8</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>

        <messsage.version>1.2.0</messsage.version>
        <example.version>1.0.0</example.version>

        <lombok.version>1.18.20</lombok.version>
        <fastjson.version>1.2.75</fastjson.version>
        <retrofit.version>2.2.11</retrofit.version>
    </properties>

    <modules>
        <module>message-spring-boot-starter</module>
        <module>message-example</module>
    </modules>

    <!-- 向maven中央仓库发布相关配置 -->
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <url>https://gitee.com/hpiot/transfer.sdk</url>
        <connection>https://gitee.com/hpiot/transfer.sdk.git</connection>
    </scm>

    <developers><!-- 配置开发者信息 -->
        <developer>
            <name>mu_feng</name>
            <email>yiluxinyu@126.com</email>
            <timezone>+8</timezone>
        </developer>
    </developers>

    <profiles>
        <profile>
            <id>disable-javadoc-doclint</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <properties>
                <javadoc.opts>-Xdoclint:none</javadoc.opts>
            </properties>
        </profile>

        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- 必须配置 source-->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.2.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <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.10.4</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <!-- java8版本导致javadoc打包编译失败时候，添加-->
                            <additionalparam>${javadoc.opts}</additionalparam>

                            <aggregate>true</aggregate>
                            <charset>${build.sourceEncoding}</charset>
                            <encoding>${build.sourceEncoding}</encoding>
                            <docencoding>${build.sourceEncoding}</docencoding>
                        </configuration>
                    </plugin>

                    <!-- 必须配置  GPG-->
                    <plugin>
                        <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>

                    <!--  必须配置 sonatype-->
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.7</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId> <!-- 等于上面Settings中server的id值。-->
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <distributionManagement>
        <repository>
            <id>repository</id> <!-- 等于上面Settings中server的id值。-->
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>

        <snapshotRepository>
            <id>ossrh</id> <!-- 等于上面Settings中server的id值。-->
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>
</project>