<?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>net.linlan.commons</groupId>
    <artifactId>commons-core</artifactId>
    <packaging>jar</packaging>
    <version>2.6.5</version>
    <name>commons-core</name>
    <description>
        The commons uitls include core, db, script, env etc, for all the projects to use.
        通用工具类，为后续应用提供工具包支撑，不使用外部繁杂的工具包。
    </description>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <maven.version>3.1.0</maven.version>
        <maven.compile.version>3.7.0</maven.compile.version>
        <maven.source.version>3.3.1</maven.source.version>
        <maven.javadoc.version>3.3.1</maven.javadoc.version>
        <maven.pluging.version>3.8.3</maven.pluging.version>
        <maven.pluging.annotations.version>3.6.1</maven.pluging.annotations.version>
        <maven.tree.version>3.1.0</maven.tree.version>
        <maven.gpg.version>3.1.0</maven.gpg.version>
        <maven.sonatype.version>0.7.0</maven.sonatype.version>

        <mybatis.version>3.5.12</mybatis.version>
        <github.pagehelper.version>5.2.0</github.pagehelper.version>
        <fasterxml.jackson.version>2.13.5</fasterxml.jackson.version>
        <fastjson.version>2.0.31</fastjson.version>

    </properties>

    <url>https://gitee.com/linlannet/java-tools-parent.git</url>
    <licenses>
        <license>
            <name>Apache-2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>
    <scm>
        <url>https://gitee.com/linlannet/java-tools-parent/tree/master/commons-core</url>
        <connection>scm:git:git://gitee.com/linlannet/java-tools-parent.git</connection>
    </scm>
    <developers>
        <developer>
            <id>linlan</id>
            <name>linlan info</name>
            <email>linlannet@163.com</email>
            <organization>Linlan Corporation</organization>
            <roles>
                <role>Member</role>
            </roles>
            <timezone>Asia/Beijing</timezone>
        </developer>
    </developers>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <!-- 数据库工具包 db -->
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>${mybatis.version}</version>
        </dependency>
        <dependency>
            <groupId>com.github.pagehelper</groupId>
            <artifactId>pagehelper</artifactId>
            <version>${github.pagehelper.version}</version>
        </dependency>

        <!-- 环境工具包 env -->
        <dependency>
            <groupId>com.github.oshi</groupId>
            <artifactId>oshi-core</artifactId>
            <version>5.5.1</version>
        </dependency>
        <!-- 脚本处理工具包 script -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>${fastjson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${fasterxml.jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${fasterxml.jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>${fasterxml.jackson.version}</version>
        </dependency>

    </dependencies>

    <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compile.version}</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <!-- 生成源代码包 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven.source.version}</version>
                <executions>
                    <!-- 第一次执行 -->
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                        <phase>package</phase>
                        <!-- 不指定分类器，生成默认的源代码 JAR 文件 -->
                    </execution>
                    <!-- 第二次执行 -->
                    <execution>
                        <id>attach-additional-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                        <phase>package</phase>
                        <!-- 为第二次执行配置分类器 -->
                        <configuration>
                            <classifier>additional</classifier>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- 生成Java文档包 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven.javadoc.version}</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- GPG 签名插件 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>${maven.gpg.version}</version>
                <executions>
                    <execution>
                        <!-- 绑定到 verify 阶段自动签名 -->
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <keyname>0EC989C27692C7D4</keyname>
                    <!-- 可选配置项 -->
                    <gpgArguments>
                        <arg>--pinentry-mode</arg>
                        <arg>loopback</arg> <!-- 解决无终端环境下的密码输入问题 -->
                    </gpgArguments>
                </configuration>
            </plugin>
            <!-- 新版本 发布到 https://central.sonatype.org/ 需要采用如下插件 -->
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>${maven.sonatype.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>sonatype-central</publishingServerId>
                    <autoPublish>true</autoPublish>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <!-- 配置发布仓库 -->
    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-central</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
        </snapshotRepository>
        <repository>
            <id>sonatype-central</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

</project>
