<?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>io.github.xxyopen</groupId>
    <artifactId>xxy-common</artifactId>
    <version>1.0.0</version>
    <modules>
        <module>xxy-cache</module>
        <module>xxy-util</module>
        <module>xxy-model</module>
        <module>xxy-web</module>
    </modules>
    <packaging>pom</packaging>
    <name>xxy-common</name>
    <description>xxy开源项目公共依赖，包括通用工具包、通用缓存、通用模型、通用web等模块</description>
    <url>https://github.com/xxyopen/xxy-common</url>

    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
        <junit.version>4.13.2</junit.version>
        <lombok.version>1.18.16</lombok.version>
    </properties>

    <dependencies>
        <!-- 全局单元测试 -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- 全局Lombok代码生成 -->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <optional>true</optional>
        </dependency>
    </dependencies>

    <!--项目的问题管理系统(Bugzilla, Jira, Scarab,或任何你喜欢的问题管理系统)的名称和URL，主要用于生成项目文档-->
    <issueManagement>
        <system>Github Issue</system>
        <url>https://github.com/xxyopen/xxy-common/issues</url>
    </issueManagement>

    <!--该元素描述了项目所有License列表。 应该只列出该项目的license列表，不要列出依赖项目的 license列表。
    如果列出多个license，用户可以选择它们中的一个而不是接受所有license。-->
    <licenses>
        <license>
            <!--license用于法律上的名称-->
            <name>Apache License 2.0</name>
            <!--官方的license正文页面的URL-->
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
            <!--项目分发的主要方式：
              repo，可以从Maven库下载
              manual， 用户必须手动下载和安装依赖-->
            <distribution>repo</distribution>
            <!--关于license的补充信息-->
            <comments>...</comments>
        </license>
    </licenses>

    <!--项目开发者列表-->
    <developers>
        <developer>
            <!--项目开发者的全名-->
            <name>xxy</name>
            <!--项目开发者的email-->
            <email>1179705413@qq.com</email>
            <!--项目开发者的主页的URL-->
            <url>https://github.com/201206030</url>
            <!--项目开发者在项目中扮演的角色，角色元素描述了各种角色-->
            <roles>
                <role>Project Manager</role>
            </roles>
            <!--项目开发者所属组织-->
            <organization>xxyOpen</organization>
            <!--项目开发者所属组织的URL-->
            <organizationUrl>https://github.com/xxyOpen</organizationUrl>
        </developer>
    </developers>

    <!--SCM(Source Control Management)标签允许你配置你的代码库，供Maven web站点和其它插件使用。 -->
    <scm>
        <connection>scm:git@github.com:xxyopen/xxy-common.git</connection>
        <developerConnection>scm:git@github.com:xxyopen/xxy-common.git</developerConnection>
        <url>git@github.com:xxyopen/xxy-common.git</url>
    </scm>

    <build>
        <plugins>
            <!-- 指定JDK的编译版本，否则会使用compiler插件默认的JDK版本号 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
        </plugins>


    </build>

    <!-- 部署命令：mvn deploy -Prelease （需要指定release环境的配置）-->
    <!-- 如果配置中包含特殊字符，比如Nexus私服密码一般会包含特殊字符，可以使用CDATA包裹，如<![CDATA[密码]]> -->
    <profiles>
        <profile>
            <id>release</id>
            <distributionManagement>
                <snapshotRepository>
                    <id>oss</id>
                    <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
                </snapshotRepository>
                <repository>
                    <id>oss</id>
                    <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
            <build>
                <plugins>
                    <!-- Source -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.2.1</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>3.3.1</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- Gpg Signature -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>