<?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>cn.itlym</groupId>
    <!--插件命名遵守${prefix}-maven-plugin-->
    <artifactId>shoulder-maven-plugin</artifactId>
    <version>1.0</version><!-- shoulder-maven-plugin.version-->
    <packaging>maven-plugin</packaging>

    <name>Shoulder ErrorCode Helper Plugin</name>
    <description>This Plugin is used to help you generate errorCode i18n.properties of your project.</description>
    <url>https://gitee.com/ChinaLym/shoulder-plugins</url>
    <inceptionYear>2020</inceptionYear>

    <properties>
        <hutool.version>5.8.15</hutool.version>
        <guava.version>31.1-jre</guava.version>

        <java.version>11</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.javadoc.charset>${project.build.sourceEncoding}</maven.javadoc.charset>

        <maven-core.version>3.9.1</maven-core.version>
        <maven-plugin-api.version>3.9.1</maven-plugin-api.version>
        <maven-plugin-annotations.version>3.8.1</maven-plugin-annotations.version>

        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
        <license-maven-plugin.version>2.0.0</license-maven-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
        <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
    </properties>

    <!-- 版本控制，供其他插件使用 todo 修改为 github-->
    <scm>
        <connection>scm:git@gitee.com:ChinaLym/shoulder-plugins.git</connection>
        <developerConnection>scm:git@gitee.com:ChinaLym/shoulder-plugins.git</developerConnection>
        <url>git@gitee.com:ChinaLym/shoulder-plugins.git</url>
    </scm>

    <!--开源许可协议采用 Apache 2.0 协议-->
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <!-- 开发者 -->
    <developers>
        <developer>
            <id>ChinaLym</id>
            <name>cnlym</name>
            <email>cn_lym@foxmail.com</email>
            <organization>shoulder.</organization>
            <organizationUrl>coming soon</organizationUrl>
            <roles>
                <role>CAFE BABE</role>
            </roles>
            <timezone>+8</timezone>
        </developer>
    </developers>

    <contributors>
        <contributor>
            <name>cnlym</name>
        </contributor>
    </contributors>

    <dependencies>

        <!-- https://mvnrepository.com/artifact/org.jboss.forge.roaster/roaster-jdt -->
        <!-- Java doc 解析工具 内部plugin将其他依赖以源码形式打包降低依赖,失去版本控制 <artifactId>maven-shade-plugin</artifactId>-->
        <dependency>
            <groupId>org.jboss.forge.roaster</groupId>
            <artifactId>roaster-jdt</artifactId>
            <version>2.28.0.Final</version>
        </dependency>

        <dependency>
            <groupId>cn.hutool</groupId>
            <artifactId>hutool-core</artifactId>
            <version>${hutool.version}</version>
        </dependency>
        <dependency>
            <groupId>cn.hutool</groupId>
            <artifactId>hutool-http</artifactId>
            <version>${hutool.version}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.google.code.findbugs/jsr305 -->
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>3.0.2</version>
        </dependency>

        <dependency>
            <groupId>cn.itlym</groupId>
            <artifactId>shoulder-core</artifactId>
            <version>0.6</version>
            <scope>test</scope>
        </dependency>

        <!-- MVN plugin standard dependency-->
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${maven-plugin-api.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>${maven-core.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>${maven-plugin-annotations.version}</version>
            <scope>provided</scope>
        </dependency>

    </dependencies>

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

    <build>
        <plugins>
            <!-- GPG  发布插件 mvn help:describe -Dplugin=org.apache.maven.plugins:maven-gpg-plugin:1.6 -->
            <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><!-- ACTIVE_WITH_verify -->
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- License Check And Sign 开原协议检查-->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${license-maven-plugin.version}</version>
                <configuration>
                    <!-- config for license:aggregate-add-third-party -->
                    <outputDirectory>${project.basedir}</outputDirectory>
                    <thirdPartyFilename>LICENSE-3RD-PARTY</thirdPartyFilename>
                    <fileTemplate>/org/codehaus/mojo/license/third-party-file-groupByLicense.ftl</fileTemplate>
                    <useMissingFile>true</useMissingFile>
                    <missingFile>${project.basedir}/LICENSE-3RD-PARTY.properties</missingFile>
                    <aggregateMissingLicensesFile>${project.basedir}/LICENSE-3RD-PARTY.properties
                    </aggregateMissingLicensesFile>
                    <licenseMerges>
                        <licenseMerge>Apache 2.0|ASL, version
                            2|http://www.apache.org/licenses/LICENSE-2.0.txt|http://asm.ow2.org/license.html|The
                            Apache License, Version 2.0|Apache License|Apache License Version 2|Apache License
                            Version 2.0|Apache Software License - Version 2.0|Apache 2.0 License|Apache License
                            2.0|ASL|Apache 2|Apache-2.0|the Apache License, ASL Version 2.0|The Apache Software
                            License, Version 2.0|Apache License, Version 2.0|Apache Public License 2.0
                        </licenseMerge>
                        <licenseMerge>BSD|The BSD 3-Clause License|The BSD License|Modified BSD License|New BSD
                            License|New BSD license|Two-clause BSD-style license|BSD licence|BSD New|The New BSD
                            License|BSD 3-Clause|BSD 3-clause
                        </licenseMerge>
                        <licenseMerge>MIT|MIT License|The MIT License</licenseMerge>
                        <licenseMerge>LGPL|LGPL, version 2.1|GNU Library or Lesser General Public License (LGPL)
                            V2.1|GNU Lesser General Public License (LGPL), Version 2.1|GNU Lesser General Public
                            License, Version 2.1|LGPL 2.1
                        </licenseMerge>
                        <licenseMerge>CDDL|CDDL+GPL|CDDL+GPL License|CDDL + GPLv2 with classpath exception|CDDL
                            License|CDDL 1.0|CDDL 1.1|COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version
                            1.0|Common Development and Distribution License (CDDL) v1.0
                        </licenseMerge>
                        <licenseMerge>EPL|Eclipse Public License - Version 1.0</licenseMerge>
                        <licenseMerge>GPL|GPL2 w/ CPE|GPLv2+CE|GNU General Public Library</licenseMerge>
                        <licenseMerge>MPL|MPL 1.1</licenseMerge>
                        <licenseMerge>Public Domain</licenseMerge>
                        <licenseMerge>Common Public License|Common Public License Version 1.0</licenseMerge>
                        <licenseMerge>CC0|CC0 1.0 Universal|Public Domain, per Creative Commons CC0</licenseMerge>
                        <licenseMerge>Unknown License|Unknown license</licenseMerge>
                    </licenseMerges>

                    <!-- config for license:aggregate-download-licenses -->
                    <aggregateDownloadLicenses.executeOnlyOnRootModule>true
                    </aggregateDownloadLicenses.executeOnlyOnRootModule>
                    <!--<licensesConfigFile>${project.basedir}/lic/config/licenses.xml</licensesConfigFile>-->
                    <licensesOutputFile>${project.basedir}/lic/licenses.xml</licensesOutputFile>
                    <licensesOutputDirectory>${project.basedir}/lic/licenses/</licensesOutputDirectory>

                    <!-- config for license:update-file-header -->
                    <licenseName>apache_v2</licenseName>
                    <inceptionYear>2020</inceptionYear>
                    <organizationName>shoulder</organizationName>
                    <projectName>shoulder-framework</projectName>
                    <roots>
                        <root>src/main/java</root>
                        <root>src/test/java</root>
                    </roots>
                    <includes>
                        <include>**/*.java</include>
                        <include>**/*.xml</include>
                        <include>**/*.sh</include>
                        <include>**/*.py</include>
                        <include>**/*.properties</include>
                        <include>**/*.sql</include>
                        <include>**/*.html</include>
                        <include>**/*.less</include>
                        <include>**/*.css</include>
                        <include>**/*.js</include>
                        <include>**/*.json</include>
                    </includes>
                    <extraExtensions>
                        <scala>java</scala>
                    </extraExtensions>
                    <canUpdateCopyright>true</canUpdateCopyright>
                    <canUpdateDescription>true</canUpdateDescription>
                    <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
                    <emptyLineAfterHeader>true</emptyLineAfterHeader>
                    <processStartTag>&lt;&lt;</processStartTag>
                    <processEndTag>&gt;&gt;</processEndTag>
                    <sectionDelimiter>==</sectionDelimiter>

                    <!-- config for mvn license:update-project-license -->
                    <licenseFile>${project.basedir}/LICENSE</licenseFile>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.13</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>oss</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <!--国内发布网络容易超时，设置长一点，1小时-->
                    <stagingProgressTimeoutMinutes>60</stagingProgressTimeoutMinutes>
                    <stagingDescription>preRelease</stagingDescription>
                    <!-- 目标仓库 -->
                    <!--<stagingRepositoryId>1078</stagingRepositoryId>-->
                    <!--<stagingDescription>preRelease</stagingDescription>-->
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>3.6.0</version>
                <configuration>
                    <!-- 或者在类的注视上添加一个descriptor -->
                    <!-- Needed for Java 5 annotation based configuration, for some reason. -->
                    <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
                </configuration>
            </plugin>

            <!-- attach source into jar -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>package</phase><!-- ACTIVE_WITH_package -->
                        <goals>
                            <goal>jar</goal>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Javadoc: 插件暂时不是很需要javadoc -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <encoding>${maven.javadoc.charset}</encoding>
                    <charset>${maven.javadoc.charset}</charset>
                    <docencoding>${maven.javadoc.charset}</docencoding>
                    <!-- 解决Javadoc 编译时报错 -->
                    <detectLinks>true</detectLinks>
                    <detectOfflineLinks>true</detectOfflineLinks>
                    <detectJavaApiLink>true</detectJavaApiLink>
                    <linksource>true</linksource>
                    <links>
                        <link>http://testng.org/javadocs/</link>
                    </links>
                </configuration>
                <!--MAVEN_OPTS=-Dfile.encoding=UTF-8;JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8-->
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <phase>package</phase><!-- ACTIVE_WITH_package -->
                        <goals>
                            <goal>jar</goal>
<!--                            <goal>javadoc</goal>-->
<!--                            <goal>test-javadoc</goal>-->
                        </goals>
                        <configuration>
                            <!-- 取消对源码中的doc参数注释等检查 3.x 之前为 additionalparam -->
                            <additionalJOption>-Xdoclint:none</additionalJOption>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

<!--            <plugin>-->
<!--                <groupId>org.apache.maven.plugins</groupId>-->
<!--                <artifactId>maven-jar-plugin</artifactId>-->
<!--                <version>2.3.1</version>-->
<!--                <configuration>-->
<!--                    <archive>-->
<!--                        <manifest>-->
<!--                            &lt;!&ndash; 在jar包的MF文件中生成Class-Path属性 &ndash;&gt;-->
<!--                            <addClasspath>true</addClasspath>-->
<!--                            &lt;!&ndash;依赖前缀&ndash;&gt;-->
<!--                            <classpathPrefix>lib/</classpathPrefix>-->
<!--                        </manifest>-->
<!--                        <manifestEntries>-->
<!--                            <Class-Path>lib/tools.jar</Class-Path>-->
<!--                        </manifestEntries>-->
<!--                    </archive>-->
<!--                </configuration>-->
<!--            </plugin>-->

        </plugins>
    </build>

</project>