<?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>com.github.hughwick</groupId>
    <artifactId>toolbox-parent</artifactId>
    <version>2.3.9</version>
    <packaging>pom</packaging>
    <modules>
        <module>toolbox-all</module>
        <module>toolbox-aop</module>
        <module>toolbox-db</module>
        <module>toolbox-core</module>
        <module>toolbox-crypto</module>
        <module>toolbox-cache</module>
        <module>toolbox-bean</module>
        <module>toolbox-json</module>
        <module>toolbox-http</module>
    </modules>

    <properties>
        <!--============================== MAIN ==============================-->
        <java.version>11</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <junit-jupiter.version>5.8.2</junit-jupiter.version>
        <!--========================== All Plugins START =====================-->
        <plugin.compiler.version>3.8.1</plugin.compiler.version>
        <plugin.sonar.version>3.1.1</plugin.sonar.version>
        <plugin.surefire.version>2.22.2</plugin.surefire.version>
        <plugin.surefire.skip-it>false</plugin.surefire.skip-it>
        <plugin.surefire.ignore-failure>false</plugin.surefire.ignore-failure>
        <plugin.maven-source-plugin.version>2.2.1</plugin.maven-source-plugin.version>
        <plugin.maven-javadoc-plugin.version>3.3.1</plugin.maven-javadoc-plugin.version>
        <plugin.maven-gpg-plugin.version>1.5</plugin.maven-gpg-plugin.version>
        <plugin.jacoco.version>0.8.8</plugin.jacoco.version>
        <!--============================== other ==============================-->
        <lombok.version>1.18.24</lombok.version>
        <spring.version>5.3.21</spring.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${junit-jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!--compiler plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${plugin.compiler.version}</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <!--=================================== coveralls START ===================================-->
            <!--命令：mvn test 生成xml txt测试报告 （maven-surefire-plugin mvn默认使用插件,可以不用配置） -->
            <!--命令：mvn surefire-report:report 生成测试报告html -->
            <!--junit5 下方插件的version要大于2.22.0，否则无法执行test-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${plugin.surefire.version}</version>
                <configuration>
                    <skipTests>${plugin.surefire.skip-it}</skipTests>
                    <!--suppress UnresolvedMavenProperty -->
                    <argLine>${argLine} -Xms256m -Xmx2048m</argLine>
                    <forkCount>1</forkCount>
                    <runOrder>random</runOrder>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${plugin.jacoco.version}</version>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!--=================================== coveralls END ===================================-->
            <!--sonar-->
            <plugin>
                <groupId>org.sonarsource.scanner.maven</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>${plugin.sonar.version}</version>
            </plugin>
        </plugins>
    </build>

    <!--============================== ADD For sonatype START ==============================-->
    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo,manual</distribution>
        </license>
    </licenses>
    <!-- SCM信息 -->
    <scm>
        <connection>scm:git:https://github.com/HughWick/toolbox.git</connection>
        <developerConnection>scm:git:https://github.com/HughWick/toolbox.git</developerConnection>
        <url>https://github.com/HughWick/toolbox</url>
        <tag>1.0.1</tag>
    </scm>
    <!-- 开发者信息 -->
    <developers>
        <developer>
            <name>Hugh Wick</name>
            <email>dang_star@live.com</email>
            <organization>personal</organization>
            <url>https://github.com/HughWick</url>
        </developer>
    </developers>
    <!--============================== ADD For sonatype END ==============================-->

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- Source -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${plugin.maven-source-plugin.version}</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>${plugin.maven-javadoc-plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- GPG -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${plugin.maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <distributionManagement>
                <snapshotRepository>
                    <id>snapshot</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
                </snapshotRepository>
                <repository>
                    <id>snapshot</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
        </profile>
    </profiles>
</project>