<?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.zhangxinhe</groupId>
    <artifactId>zen-collection</artifactId>
    <version>1.0.0</version>
    <!--version>1.0.0-SNAPSHOT</version-->
    <packaging>jar</packaging>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>base on tool</description>
    <url>https://github.com/zhangxinhe/zen-collection</url>



    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>


        <maven.compiler.plugin.version>3.6.1</maven.compiler.plugin.version>
        <maven.javadoc.plugin.version>3.0.1</maven.javadoc.plugin.version>
        <maven.source.plugin.version>3.0.1</maven.source.plugin.version>
        <maven.gpg.plugin.version>1.5</maven.gpg.plugin.version>
        <nexus.staging.maven.plugin.version>1.6.8</nexus.staging.maven.plugin.version>
        <chartset.UTF8>UTF-8</chartset.UTF8>
    </properties>

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

    <scm>
        <url>https://github.com/zhangxinhe/zen-collection</url>
        <connection>https://github.com/zhangxinhe/zen-collection.git</connection>
        <developerConnection>https://github.com/zhangxinhe/zen-collection.git</developerConnection>
    </scm>

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

    <developers>
        <developer>
            <name>zhangxinhe</name>
            <email>zhangxinhe2018@gmail.com</email>
            <roles>
                <role>Developer</role>
            </roles>
            <timezone>+8</timezone>
        </developer>
    </developers>


    <build>
        <plugins>
            <!--<plugin>-->
            <!--<groupId>org.sonatype.pluginss</groupId>-->
            <!--<artifactId>nexus-staging-maven-plugin</artifactId>-->
            <!--<version>${nexus.staging.maven.plugin.version}</version>-->
            <!--<extensions>true</extensions>-->
            <!--<configuration>-->
            <!--<serverId>sonatype</serverId>-->
            <!--<nexusUrl>https://oss.sonatype.org/</nexusUrl>-->
            <!--<autoReleaseAfterClose>true</autoReleaseAfterClose>-->
            <!--</configuration>-->
            <!--</plugin>-->

            <!--编译插件-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.plugin.version}</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>${chartset.UTF8}</encoding>
                </configuration>
            </plugin>


            <!--生产源码文件插件-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven.source.plugin.version}</version>
                <configuration>
                    <attach>true</attach>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>compile</phase>
                        <goals>
                            <!--<goal>jar-no-fork</goal>-->
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!--生产javadoc插件-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven.javadoc.plugin.version}</version>
                <configuration>
                    <encoding>${chartset.UTF8}</encoding>
                    <charset>${chartset.UTF8}</charset>
                    <docencoding>${chartset.UTF8}</docencoding>
                    <destDir>doc</destDir>
                    <!--<aggregate>true</aggregate>-->
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <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>${maven.gpg.plugin.version}</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>

        <profile>
            <id>disable-javadoc-doclint</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <!-- java8版本导致javadoc打包编译失败时候，添加-->
            <properties>
                <javadoc.opts>-Xdoclint:none</javadoc.opts>
            </properties>
        </profile>


        <profile>
            <!-- 本地开发环境 -->
            <id>dev</id>
            <properties>
                <profiles.active>dev</profiles.active>
            </properties>
            <activation>
                <!-- 设置默认激活这个配置 -->
                <activeByDefault>true</activeByDefault>
            </activation>

        </profile>

        <profile>
            <!--打包环境-->
            <id>release</id>
            <properties>
                <profiles.active>release</profiles.active>
            </properties>

            <!--定义snapshots库和releases库的nexus地址-->
            <distributionManagement>
                <snapshotRepository>
                    <!--oss需要对应到settings.xml下的service的id-->
                    <id>sonatype</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
                </snapshotRepository>
                <repository>
                    <id>sonatype</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
        </profile>

        <profile>
            <!-- 测试环境 -->
            <id>beta</id>
            <properties>
                <profiles.active>beta</profiles.active>
            </properties>
        </profile>
    </profiles>


</project>