<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2020 Holy All rights reserved.
  -->
<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>cc.holylcd</groupId>
  <artifactId>qiyi-dependencies</artifactId>
  <version>1.0.0</version>
  <packaging>pom</packaging>

  <name>qiyi-dependencies</name>
  <description>API service dependency management</description>
  <url>https://holylcd.github.io</url>
  <inceptionYear>2021</inceptionYear>
  <organization>
    <name>QiYi Studios</name>
    <url>https://holylcd.github.io</url>
  </organization>
  <developers>
    <developer>
      <name>holy</name>
      <email>holylcd@foxmail.com</email>
    </developer>
  </developers>

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

  <scm>
    <connection>scm:git:git@github.com:qiyi-studio/qiyi-dependencies.git</connection>
    <developerConnection>scm:git:ssh://github.com:qiyi-studio/qiyi-dependencies.git</developerConnection>
    <url>https://github.com/qiyi-studio/qiyi-dependencies</url>
  </scm>

  <properties>
    <spring-boot.version>2.6.6</spring-boot.version>
    <!--版本号注意和 spring-boot-dependencies 保持一致-->
    <lombok.version>1.18.22</lombok.version>

    <mysql-connector-java.version>8.0.28</mysql-connector-java.version>
    <mybatis-plus-boot-starter.version>3.5.1</mybatis-plus-boot-starter.version>

    <!--3.0.3 页面调试响应异常, 不清楚原因，API 文档插件无所谓，暂搁置-->
    <knife4j-spring-boot-starter.version>3.0.2</knife4j-spring-boot-starter.version>

    <!--最新版本不支持 MySQL5.7, 降级处理-->
    <flyway.version>5.2.4</flyway.version>

    <java-jwt.version>3.18.3</java-jwt.version>

    <weixin-java-group.version>4.3.0</weixin-java-group.version>

    <aliyun-sdk-oss.version>3.13.0</aliyun-sdk-oss.version>

    <kaptcha.version>2.3.2</kaptcha.version>

    <mapstruct.version>1.4.2.Final</mapstruct.version>
    <lombok-mapstruct-binding.version>0.2.0</lombok-mapstruct-binding.version>

    <jasypt.version>3.0.4</jasypt.version>

    <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>

    <java.version>17</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.build.locales>zh_CN</project.build.locales>

    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <maven.compiler.encoding>UTF-8</maven.compiler.encoding>
  </properties>

  <repositories>
    <repository>
      <id>aliyun</id>
      <url>https://maven.aliyun.com/repository/central</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>aliyun-plugin</id>
      <url>https://maven.aliyun.com/repository/central</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>

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

      <!--MySQL-->
      <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>${mysql-connector-java.version}</version>
        <scope>runtime</scope>
      </dependency>

      <!--Mybatis Plus-->
      <dependency>
        <groupId>com.baomidou</groupId>
        <artifactId>mybatis-plus-boot-starter</artifactId>
        <version>${mybatis-plus-boot-starter.version}</version>
      </dependency>

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

      <!--flyway-->
      <dependency>
        <groupId>org.flywaydb</groupId>
        <artifactId>flyway-core</artifactId>
        <version>${flyway.version}</version>
      </dependency>

      <!--swagger-->
      <dependency>
        <groupId>com.github.xiaoymin</groupId>
        <artifactId>knife4j-spring-boot-starter</artifactId>
        <version>${knife4j-spring-boot-starter.version}</version>
      </dependency>

      <!--jwt-->
      <dependency>
        <groupId>com.auth0</groupId>
        <artifactId>java-jwt</artifactId>
        <version>${java-jwt.version}</version>
      </dependency>

      <!-- g微信 官方sdk都没有-->
      <dependency>
        <groupId>com.github.binarywang</groupId>
        <artifactId>weixin-java-miniapp</artifactId>
        <version>${weixin-java-group.version}</version>
      </dependency>
      <dependency>
        <groupId>com.github.binarywang</groupId>
        <artifactId>weixin-java-pay</artifactId>
        <version>${weixin-java-group.version}</version>
      </dependency>

      <!-- OSS -->
      <dependency>
        <groupId>com.aliyun.oss</groupId>
        <artifactId>aliyun-sdk-oss</artifactId>
        <version>${aliyun-sdk-oss.version}</version>
      </dependency>

      <!-- lombok. spring-boot-dependencies has controlled version, so ignore here -->
      <!--<dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>${lombok.version}</version>
        <optional>true</optional>
      </dependency>-->

      <!--kaptcha-->
      <dependency>
        <groupId>com.github.penggle</groupId>
        <artifactId>kaptcha</artifactId>
        <version>${kaptcha.version}</version>
      </dependency>

      <!--mapstruct-->
      <dependency>
        <groupId>org.mapstruct</groupId>
        <artifactId>mapstruct</artifactId>
        <version>${mapstruct.version}</version>
        <scope>compile</scope>
      </dependency>
      <dependency>
        <groupId>org.mapstruct</groupId>
        <artifactId>mapstruct-processor</artifactId>
        <version>${mapstruct.version}</version>
        <scope>compile</scope>
      </dependency>

    </dependencies>
  </dependencyManagement>

  <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>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.2.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.4.0</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.13</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven-compiler-plugin.version}</version>
          <!--<configuration>
            <source>${maven.compiler.source}</source>
            <target>${maven.compiler.target}</target>
            &lt;!&ndash; According to this documentation, the provided dependency processor is not considered!   &ndash;&gt;
            <annotationProcessorPaths>
              <path>
                <groupId>org.mapstruct</groupId>
                <artifactId>mapstruct-processor</artifactId>
                <version>${mapstruct.version}</version>
              </path>
              <path>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
              </path>
              <path>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok-mapstruct-binding</artifactId>
                <version>${lombok-mapstruct-binding.version}</version>
              </path>
            </annotationProcessorPaths>
          </configuration>-->
        </plugin>
        <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <version>${spring-boot.version}</version>
          <configuration>
            <excludes>
              <exclude>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
              </exclude>
            </excludes>
          </configuration>
        </plugin>
        <plugin>
          <!--版本号管理插件-->
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <version>2.7</version>
          <configuration>
            <generateBackupPoms>false</generateBackupPoms>
          </configuration>
        </plugin>

        <!--CHANGELOG plugin-->
        <!--<plugin>
          <groupId>se.bjurr.gitchangelog</groupId>
          <artifactId>git-changelog-maven-plugin</artifactId>
          <version>1.92</version>
          <executions>
            <execution>
              <id>GenerateGitChangelog</id>
              <phase>generate-sources</phase>
              <goals>
                <goal>git-changelog</goal>
              </goals>
              <configuration>
                <templateContent>
                  <![CDATA[
  # Changelog

  Changelog for {{ownerName}} {{repoName}}.

  {{#tags}}
  {{#ifReleaseTag .}}
  ## [{{name}}](https://gitlab.com/html-validate/html-validate/compare/{{name}}) ({{tagDate .}})

    {{#ifContainsBreaking commits}}
      ### Breaking changes

      {{#commits}}
        {{#ifCommitBreaking .}}
    - {{#eachCommitScope .}} **{{.}}** {{/eachCommitScope}} {{{commitDescription .}}} ([{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}))
        {{/ifCommitBreaking}}
      {{/commits}}
    {{/ifContainsBreaking}}


    {{#ifContainsType commits type='feat'}}
      ### Features

      {{#commits}}
        {{#ifCommitType . type='feat'}}
    - {{#eachCommitScope .}} **{{.}}** {{/eachCommitScope}} {{{commitDescription .}}} ([{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}))
        {{/ifCommitType}}
      {{/commits}}
    {{/ifContainsType}}


    {{#ifContainsType commits type='fix'}}
      ### Bug Fixes

      {{#commits}}
        {{#ifCommitType . type='fix'}}
          - {{#eachCommitScope .}} **{{.}}** {{/eachCommitScope}} {{{commitDescription .}}} ([{{hash}}](https://github.com/{{ownerName}}/{{repoName}}/commit/{{hash}}))
        {{/ifCommitType}}
      {{/commits}}
    {{/ifContainsType}}

  {{/ifReleaseTag}}
  {{/tags}}
                  ]]>
                </templateContent>
              </configuration>
            </execution>
          </executions>
        </plugin>-->
      </plugins>
    </pluginManagement>
  </build>
</project>
