<?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>club.javafamily</groupId>
   <artifactId>javafamily-cache</artifactId>
   <version>2.3.2-beta.4</version>
   <name>${project.artifactId}</name>
   <url>https://github.com/JavaFamilyClub/javafamily-cache</url>
   <description>${project.artifactId}</description>

   <!-- 许可证信息 -->
   <licenses>
      <!-- Apache许可证 -->
      <license>
         <name>The Apache Software License, Version 2.0</name>
         <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      </license>
   </licenses>
   <!-- SCM信息 -> git在github上托管 -->
   <scm>
      <url>https://github.com/JavaFamilyClub/javafamily-cache</url>
      <connection>scm:git:git://github.com/JavaFamilyClub/javafamily-cache.git</connection>
      <developerConnection>scm:git:ssh://git@github.com/JavaFamilyClub/javafamily-cache.git</developerConnection>
   </scm>

   <!-- 开发者信息 -->
   <developers>
      <developer>
         <name>JavaFamily</name>
         <email>javafamily.club@outlook.com</email>
         <organization>JavaFamily</organization>
         <roles>
            <role>Developer</role>
         </roles>
         <timezone>+8</timezone>
      </developer>
   </developers>

   <distributionManagement>
      <snapshotRepository>
         <id>javafamily-central-snapshot</id>
         <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      </snapshotRepository>
      <repository>
         <id>javafamily-central-release</id>
         <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
      </repository>
   </distributionManagement>

   <properties>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      <jdk.version>1.8</jdk.version>
      <maven.compiler.source>${jdk.version}</maven.compiler.source>
      <maven.compiler.target>${jdk.version}</maven.compiler.target>
      <spring.boot.version>2.3.2.RELEASE</spring.boot.version>
      <maven.compile.plugin.version>3.6.0</maven.compile.plugin.version>

      <caffeine.version>2.8.5</caffeine.version>

      <javafamily.utils.version>2.3.2-beta.4</javafamily.utils.version>
   </properties>

   <dependencyManagement>

      <dependencies>
         <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>${spring.boot.version}</version>
         </dependency>

         <dependency>
            <groupId>com.github.ben-manes.caffeine</groupId>
            <artifactId>caffeine</artifactId>
            <version>${caffeine.version}</version>
         </dependency>

         <dependency>
            <groupId>club.javafamily</groupId>
            <artifactId>javafamily-utils-core</artifactId>
            <version>${javafamily.utils.version}</version>
         </dependency>

         <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
         </dependency>

         <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
            <version>${spring.boot.version}</version>
         </dependency>

         <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-redis</artifactId>
            <version>${spring.boot.version}</version>
         </dependency>

      </dependencies>
   </dependencyManagement>

   <dependencies>

      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-web</artifactId>
         <scope>provided</scope>
      </dependency>

      <dependency>
         <groupId>com.github.ben-manes.caffeine</groupId>
         <artifactId>caffeine</artifactId>
      </dependency>

      <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-configuration-processor</artifactId>
         <optional>true</optional>
      </dependency>

      <dependency>
         <groupId>org.springframework.data</groupId>
         <artifactId>spring-data-redis</artifactId>
         <scope>provided</scope>
      </dependency>

   </dependencies>

   <build>
      <pluginManagement>
         <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>2.9.1</version>
               <executions>
                  <execution>
                     <id>attach-javadocs</id>
                     <goals>
                        <goal>jar</goal>
                     </goals>
                  </execution>
               </executions>
               <configuration>
                  <source>${java.version}</source>
                  <additionalJOption>-Xdoclint:none</additionalJOption>
                  <failOnError>false</failOnError>
               </configuration>
            </plugin>

            <plugin>
               <groupId>org.sonatype.plugins</groupId>
               <artifactId>nexus-staging-maven-plugin</artifactId>
               <version>1.6.8</version>
               <!-- autoReleaseAfterClose的值为true，则脚本会自动完成在平台上close、release的操作，至此你将成功发布了 -->
               <extensions>true</extensions>
               <configuration>
                  <serverId>javafamily-central-release</serverId>
                  <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                  <autoReleaseAfterClose>true</autoReleaseAfterClose>
               </configuration>
            </plugin>

            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-release-plugin</artifactId>
               <version>2.5.3</version>
               <configuration>
                  <autoVersionSubmodules>true</autoVersionSubmodules>
                  <useReleaseProfile>false</useReleaseProfile>
                  <releaseProfiles>release</releaseProfiles>
                  <goals>deploy</goals>
               </configuration>
            </plugin>

            <!--  必须配置GPG插件用于使用以下配置对组件进行签名 -->
            <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>
                     <configuration>
                        <!-- Prevent `gpg` from using pinentry programs -->
                        <gpgArguments>
                           <arg>--pinentry-mode</arg>
                           <arg>loopback</arg>
                        </gpgArguments>
                     </configuration>
                  </execution>
               </executions>
            </plugin>

            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-archetype-plugin</artifactId>
               <version>3.2.0</version>
            </plugin>

            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-compiler-plugin</artifactId>
               <version>${maven.compile.plugin.version}</version>
               <configuration>
                  <source>${jdk.version}</source>
                  <target>${jdk.version}</target>
                  <!--                  <encoding>${project.build.sourceEncoding}}</encoding>-->
               </configuration>
            </plugin>

            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-resources-plugin</artifactId>
               <version>3.0.2</version>
               <configuration>
                  <encoding>${project.build.sourceEncoding}</encoding>
               </configuration>
            </plugin>

            <plugin>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-maven-plugin</artifactId>
               <version>${spring.boot.version}</version>
               <configuration>
                  <skip>true</skip>
               </configuration>
            </plugin>

            <plugin>
               <groupId>com.spotify</groupId>
               <artifactId>dockerfile-maven-plugin</artifactId>
               <version>${docker-build.plugin.version}</version>
            </plugin>

            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-checkstyle-plugin</artifactId>
               <version>3.1.1</version>
               <configuration>
                  <configLocation>codeStyle/google_checks.xml</configLocation>
                  <includeTestSourceDirectory>true</includeTestSourceDirectory>
                  <encoding>${project.build.sourceEncoding}</encoding>
                  <consoleOutput>true</consoleOutput>
                  <logViolationsToConsole>true</logViolationsToConsole>
                  <failsOnError>false</failsOnError>
                  <failOnViolation>false</failOnViolation>
                  <violationSeverity>warning</violationSeverity>
                  <linkXRef>false</linkXRef>
                  <skip>true</skip>
               </configuration>
               <executions>
                  <execution>
                     <id>validate</id>
                     <phase>validate</phase>
                     <goals>
                        <goal>check</goal>
                     </goals>
                  </execution>
               </executions>
            </plugin>

            <plugin>
               <groupId>org.codehaus.mojo</groupId>
               <artifactId>findbugs-maven-plugin</artifactId>
               <version>3.0.5</version>
               <configuration>
                  <!-- 设置分析工作的等级，可以为Min、Default 和 Max -->
                  <effort>Default</effort>
                  <!-- Low、Medium 和 High (Low最严格) -->
                  <threshold>Medium</threshold>
                  <failOnError>false</failOnError>
                  <includeTests>true</includeTests>
                  <excludeFilterFile>codeStyle/findbugs-exclude-bugs.xml</excludeFilterFile>
                  <skip>true</skip>
               </configuration>
               <executions>
                  <execution>
                     <id>run-findbugs</id>
                     <phase>package</phase>
                     <goals>
                        <!--检查不通过会构建失败，使用findbugs，失败也会构建-->
                        <goal>check</goal>
                     </goals>
                  </execution>
               </executions>
            </plugin>

            <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-antrun-plugin</artifactId>
               <version>1.8</version>
               <executions>
                  <execution>
                     <phase>validate</phase>
                     <goals>
                        <goal>run</goal>
                     </goals>
                     <configuration>
                        <tasks>
                           <echo>Copy mvnw file</echo>
                           <copy file="mvnw" tofile="${basedir}/target/generated-sources/archetype/mvnw"/>
                           <copy todir="${basedir}/target/generated-sources/archetype/.mvn">
                              <fileset dir=".mvn">
                                 <include name="**/*"/>
                              </fileset>
                           </copy>
                        </tasks>
                     </configuration>
                  </execution>
               </executions>
            </plugin>
         </plugins>
      </pluginManagement>

      <plugins>
         <plugin>
            <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>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
               <execution>
                  <id>attach-javadocs</id>
                  <goals>
                     <goal>jar</goal>
                  </goals>
               </execution>
            </executions>
            <configuration>
               <source>${java.version}</source>
               <additionalJOption>-Xdoclint:none</additionalJOption>
               <failOnError>false</failOnError>
            </configuration>
         </plugin>

         <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <!-- autoReleaseAfterClose的值为true，则脚本会自动完成在平台上close、release的操作，至此你将成功发布了 -->
            <extensions>true</extensions>
            <configuration>
               <serverId>javafamily-central-release</serverId>
               <nexusUrl>https://oss.sonatype.org/</nexusUrl>
               <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
         </plugin>

         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <configuration>
               <autoVersionSubmodules>true</autoVersionSubmodules>
               <useReleaseProfile>false</useReleaseProfile>
               <releaseProfiles>release</releaseProfiles>
               <goals>deploy</goals>
            </configuration>
         </plugin>

         <!--  必须配置GPG插件用于使用以下配置对组件进行签名 -->
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
               <execution>
                  <id>sign-artifacts</id>
                  <phase>verify</phase>
                  <goals>
                     <goal>sign</goal>
                  </goals>
                  <configuration>
                     <!-- Prevent `gpg` from using pinentry programs -->
                     <gpgArguments>
                        <arg>--pinentry-mode</arg>
                        <arg>loopback</arg>
                     </gpgArguments>
                  </configuration>
               </execution>
            </executions>
         </plugin>
      </plugins>
   </build>
</project>
