<?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>

  <artifactId>project-commons</artifactId>
  <groupId>cn.fscode.commons</groupId>
  <version>${revision}</version>

  <packaging>pom</packaging>
  <name>${project.artifactId}</name>
  <description>project commons 适用所有java项目的公共库, 方便快速集成和使用, 提供工作效率</description>
  <url>https://gitee.com/sgy_project/project-commons</url>
  <properties>
    <main.basedir>${basedir}</main.basedir>
<!--    <revision>1.0.0-SNAPSHOT</revision>-->
    <revision>1.0.0</revision>
<!--    <revision>0.0.1</revision>-->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <flatten-maven-plugin.version>1.2.7</flatten-maven-plugin.version>
    <xml-maven-plugin.version>1.0.2</xml-maven-plugin.version>
    <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
    <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
    <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
    <maven-javadoc-plugin.version>3.4.1</maven-javadoc-plugin.version>
    <versions-maven-plugin.version>2.10.0</versions-maven-plugin.version>
    <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
    <git.url>https://gitee.com/sgy_project/project-commons</git.url>
    <git.connection>scm:git:git:/gitee.com/sgy_project/project-commons.git</git.connection>
    <git.developerConnection>scm:git:ssh://git@gitee.com/sgy_project/project-commons.git</git.developerConnection>
  </properties>

  <modules>
    <module>commons-dependencies</module>
    <module>commons-core-spring-boot-starter</module>
    <module>commons-web-spring-boot-starter</module>
    <module>commons-orm-spring-boot-starter</module>
    <module>commons-idgenerator-spring-boot-starter</module>
    <module>commons-storage-spring-boot-starter</module>
    <module>commons-mq-spring-boot-starter</module>
    <module>commons-cache-spring-boot-starter</module>
    <module>commons-log-spring-boot-starter</module>
    <module>commons-lock-spring-boot-starter</module>
    <module>commons-knife4j-spring-boot-starter</module>
    <module>commons-grpc-spring-boot-starter</module>
    <module>commons-demo</module>
    <module>commons-tool</module>
    <module>commons-file-upload-spring-boot-starter</module>
    <module>commons-dynamic-datasource-spring-boot-starter</module>
    <module>commons-data-mate-spring-boot-starter</module>
    <module>commons-knife4j-micro-spring-boot-starter</module>
    <module>commons-sms-spring-boot-starter</module>
    <module>commons-security-spring-boot-starter</module>
    <module>commons-ip2region-spring-boot-starter</module>
    <module>commons-mock-data-spring-boot-starter</module>
    <module>commons-parent</module>
    <module>commons-database-spring-boot-starter</module>
  </modules>

  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://mit-license.org/</url>
    </license>
  </licenses>
  <scm>
    <url>${git.url}</url>
    <connection>${git.connection}</connection>
    <developerConnection>${git.developerConnection}</developerConnection>
  </scm>
  <developers>
    <developer>
      <name>shenguangyang</name>
      <email>shenguangyang@foxmail.com</email>
      <roles>
        <role>Developer</role>
      </roles>
      <timezone>+8</timezone>
    </developer>
  </developers>

  <build>
    <plugins>

    </plugins>
  </build>

  <!--
  上传到中央仓库注意事项
  1. pom.xml 中必须包括：name、description、url、licenses、developers、scm 等基本信息，
     使用了 Maven 的 profile 功能，只有在 release 的时候，创建源码包、文档包、使用 GPG 进行数字签名。
  2. 此外，snapshotRepository 与 repository 中的 id 一定要与 setting.xml 中 server 的 id 保持一致。
  3. 如果是多模块项目的话，只需要在父 pom.xml 中声明这些，子 pom.xml 中只需要修改相应的一些信息，如 name 标签。
  4. close过程中javadoc、source、gpg三个缺一不可
  -->
  <profiles>
    <profile>
      <id>release</id>
      <!-- 这里的id与setting.xml中sever配置的id要一致。 -->
      <distributionManagement>
        <snapshotRepository>
          <id>ossrh</id>
          <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
          <id>ossrh</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>${maven-source-plugin.version}</version>
            <executions>
              <execution>
                <id>oss</id>
                <phase>package</phase>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <!-- Gpg Signature -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven-gpg-plugin.version}</version>
            <executions>
              <execution>
                <id>oss</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</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>
              <doclint>none</doclint>
              <charset>UTF-8</charset>
              <encoding>UTF-8</encoding>
              <docencoding>UTF-8</docencoding>
              <tags>
                <tag>
                  <name>apiNote</name>
                  <placement>a</placement>
                  <head>API Note:</head>
                </tag>
                <tag>
                  <name>implSpec</name>
                  <placement>a</placement>
                  <head>Implementation Requirements:</head>
                </tag>
                <tag>
                  <name>implNote</name>
                  <placement>a</placement>
                  <head>Implementation Note:</head>
                </tag>
              </tags>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>${nexus-staging-maven-plugin.version}</version>
            <extensions>true</extensions>
            <configuration>
              <!-- 这里的id与setting.xml中sever配置的id要一致。 -->
              <serverId>ossrh</serverId>
              <nexusUrl>https://s01.oss.sonatype.org</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>