<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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>cn.tellyouwhat</groupId>
    <artifactId>gangsutils</artifactId>
    <packaging>pom</packaging>
    <version>2.1.2</version>

    <description>scala spark utils pack</description>

    <name>gangsutils</name>
    <organization>
        <name>cn.tellyouwhat</name>
    </organization>
    <url>https://github.com/HarborZeng/gangsutils</url>

    <developers>
        <developer>
            <id>HarborZeng</id>
            <name>HarborZeng</name>
            <url>https://github.com/HarborZeng</url>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>Apache 2</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <modules>
        <module>gangsutils-all</module>
        <module>gangsutils-core</module>
        <module>gangsutils-spark</module>
        <module>gangsutils-hadoop</module>
        <module>gangsutils-logger</module>
    </modules>

    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <spark.version>3.1.2</spark.version>
        <scala.minorVersion>2.12</scala.minorVersion>
        <scala.version>2.12.14</scala.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>cn.tellyouwhat</groupId>
                <artifactId>gangsutils-core</artifactId>
                <version>2.1.2</version>
            </dependency>
            <dependency>
                <groupId>cn.tellyouwhat</groupId>
                <artifactId>gangsutils-logger</artifactId>
                <version>2.1.2</version>
            </dependency>
            <dependency>
                <groupId>cn.tellyouwhat</groupId>
                <artifactId>gangsutils-spark</artifactId>
                <version>2.1.2</version>
            </dependency>
            <dependency>
                <groupId>cn.tellyouwhat</groupId>
                <artifactId>gangsutils-hadoop</artifactId>
                <version>2.1.2</version>
            </dependency>
            <dependency>
                <groupId>cn.tellyouwhat</groupId>
                <artifactId>gangsutils-all</artifactId>
                <version>2.1.2</version>
            </dependency>
            <dependency>
                <groupId>org.apache.spark</groupId>
                <artifactId>spark-core_${scala.minorVersion}</artifactId>
                <version>3.1.2</version>
            </dependency>
            <dependency>
                <groupId>org.apache.spark</groupId>
                <artifactId>spark-sql_${scala.minorVersion}</artifactId>
                <version>3.1.2</version>
            </dependency>
            <dependency>
                <groupId>org.scalaj</groupId>
                <artifactId>scalaj-http_${scala.minorVersion}</artifactId>
                <version>2.4.2</version>
            </dependency>
            <dependency>
                <groupId>org.apache.hadoop</groupId>
                <artifactId>hadoop-common</artifactId>
                <version>3.3.1</version>
            </dependency>
            <dependency>
                <groupId>io.circe</groupId>
                <artifactId>circe-parser_${scala.minorVersion}</artifactId>
                <version>0.14.1</version>
            </dependency>
            <dependency>
                <groupId>io.circe</groupId>
                <artifactId>circe-generic_${scala.minorVersion}</artifactId>
                <version>0.14.1</version>
            </dependency>
            <dependency>
                <groupId>io.circe</groupId>
                <artifactId>circe-yaml_${scala.minorVersion}</artifactId>
                <version>0.14.1</version>
            </dependency>
            <dependency>
                <groupId>commons-codec</groupId>
                <artifactId>commons-codec</artifactId>
                <version>1.15</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${scala.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.scalactic</groupId>
            <artifactId>scalactic_${scala.minorVersion}</artifactId>
            <version>3.2.9</version>
        </dependency>
        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_${scala.minorVersion}</artifactId>
            <version>3.2.9</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest-flatspec_${scala.minorVersion}</artifactId>
            <version>3.2.9</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-scala-scalatest_${scala.minorVersion}</artifactId>
            <version>1.16.37</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>com.amashchenko.maven.plugin</groupId>
                <artifactId>gitflow-maven-plugin</artifactId>
                <version>1.16.0</version>
                <configuration>
                    <gitFlowConfig>
                        <versionTagPrefix>v</versionTagPrefix>
                    </gitFlowConfig>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.7</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>

            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>4.5.3</version>
                <executions>
                    <execution>
                        <id>scala-compile-first</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>add-source</goal>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>scala-test-compile</id>
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>doc-jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <scalaVersion>${scala.version}</scalaVersion>
                </configuration>
            </plugin>
            <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-surefire-plugin</artifactId>
                <version>2.22.2</version>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.scalatest</groupId>
                <artifactId>scalatest-maven-plugin</artifactId>
                <version>2.0.2</version>
                <configuration>
                    <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
                    <junitxml>.</junitxml>
                    <filereports>WDF TestSuite.txt</filereports>
                </configuration>
                <executions>
                    <execution>
                        <id>test</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>cn/tellyouwhat/gangsutils/useless/**/*</exclude>
                        <exclude>cn/tellyouwhat/gangsutils/core/constants*.class</exclude>
                        <exclude>cn/tellyouwhat/gangsutils/**/exceptions/**/*</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.7</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <scm>
        <connection>scm:git:git@github.com:HarborZeng/gangsutils.git</connection>
        <url>https://github.com/HarborZeng/gangsutils</url>
        <developerConnection>scm:git:git@github.com:HarborZeng/gangsutils.git</developerConnection>
    </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>deploy</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <!-- Prevent `gpg` from using pinentry programs -->
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
