<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.bjlhx15</groupId>
    <version>0.0.2</version>
    <artifactId>maven-archetypes-webapp</artifactId>

    <packaging>jar</packaging>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

    <build>
        <!--        <resources>-->
        <!--            <resource>-->
        <!--                <directory>src/main/resources</directory>-->
        <!--        变量过滤 可能会有 groupID artifactId 等变量提前替换，架构项目禁止设置-->
        <!--                <filtering>true</filtering>-->
        <!--            </resource>-->
        <!--        </resources>-->
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <!--                    maven打包项目的时候pom.xml配置文件里可以配置对项目进行统一编码，-->
                    <!--                    但是部分文件 可能不需要进行重新编码，例如： 证书文件；重新编码后可能导致证书不可用。-->
                    <!-- 过滤后缀不需要转码的文件  后缀名.crt/.p8 -->
                    <encoding>UTF-8</encoding>
                    <nonFilteredFileExtensions>
                        <nonFilteredFileExtension>crt</nonFilteredFileExtension>
                        <nonFilteredFileExtension>md</nonFilteredFileExtension>
                    </nonFilteredFileExtensions>
                </configuration>
            </plugin>

            <!-- maven 编译-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>


    <!--上传jar配置-->
    <!-- 基础信息-->
    <name>${project.groupId}:${project.artifactId}</name>
    <description>pdf 生成</description>
    <url>https://github.com/bjlhx15/</url>
    <!--开源授权信息-->
    <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 信息-->
    <scm>
        <url>https://github.com/bjlhx15/java_base_architecture</url>
        <connection>scm:git:https://github.com/bjlhx15/java_base_architecture.git</connection>
        <developerConnection>scm:git:https://github.com/bjlhx15/java_base_architecture.git</developerConnection>
    </scm>
    <!--开发者信息-->
    <developers>
        <developer>
            <name>lihongxu</name>
            <email>bjlhx15@163.com</email>
            <url>https://github.com/bjlhx15/java_base_architecture</url>
        </developer>
    </developers>
    <!--版本库信息-->
    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>sonatype-nexus-staging</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
    <!--综合打包信息-->
    <profiles>
        <!--快照版本-->
        <!--mvn clean deploy -P snapshots -Dmaven.test.skip=true -->
        <profile>
            <id>snapshots</id>
            <build>
                <plugins>
                    <!--用来将工程发布到中央仓库-->
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>sonatype-nexus-snapshots</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <!-- maven relaese-->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-release-plugin</artifactId>
                        <version>2.5</version>
                        <configuration>
                            <autoVersionSubmodules>true</autoVersionSubmodules>
                            <useReleaseProfile>false</useReleaseProfile>
                            <releaseProfiles>release</releaseProfiles>
                            <goals>deploy</goals>
                        </configuration>
                    </plugin>
                    <!-- maven 编译-->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>3.0</version>
                        <configuration>
                            <source>1.8</source>
                            <target>1.8</target>
                        </configuration>
                    </plugin>
                    <!-- 源码打包插件-->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.2.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!--生成Javadoc，关闭doclint,避免注解检查不通过-->
                    <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>
                            <!-- 解决 java8 下发布到 maven 中心库时，生成 doc 的异常 -->
                            <additionalparam>-Xdoclint:none</additionalparam>
                            <encoding>${project.build.sourceEncoding}</encoding>
                            <outputDirectory>${basedir}</outputDirectory>
                            <reportOutputDirectory>${basedir}</reportOutputDirectory>
                        </configuration>
                    </plugin>

                    <!-- GPG自动签名的插件-->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!--release-->
        <!--mvn clean deploy -P release -Dmaven.test.skip=true -->
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!--用来将工程发布到中央仓库-->
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>sonatype-nexus-staging</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <!-- maven relaese-->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-release-plugin</artifactId>
                        <version>2.5</version>
                        <configuration>
                            <autoVersionSubmodules>true</autoVersionSubmodules>
                            <useReleaseProfile>false</useReleaseProfile>
                            <releaseProfiles>release</releaseProfiles>
                            <goals>deploy</goals>
                        </configuration>
                    </plugin>
                    <!-- maven 编译-->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>3.0</version>
                        <configuration>
                            <source>1.8</source>
                            <target>1.8</target>
                        </configuration>
                    </plugin>
                    <!-- 源码打包插件-->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.2.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!--生成Javadoc，关闭doclint,避免注解检查不通过-->
                    <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>
                            <!-- 解决 java8 下发布到 maven 中心库时，生成 doc 的异常 -->
                            <additionalparam>-Xdoclint:none</additionalparam>
                            <encoding>${project.build.sourceEncoding}</encoding>
                            <outputDirectory>${basedir}</outputDirectory>
                            <reportOutputDirectory>${basedir}</reportOutputDirectory>
                        </configuration>
                    </plugin>

                    <!-- GPG自动签名的插件-->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>