<?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.shoulder</groupId>
    <!--插件命名遵守${prefix}-maven-plugin-->
    <artifactId>shoulder-maven-plugin</artifactId>
    <version>1.2.2</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>
        <roaster-jdt.version>2.29.0.Final</roaster-jdt.version>
        <hutool.version>5.8.22</hutool.version>
        <guava.version>32.1.2-jre</guava.version>

        <java.version>17</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.plugin.validation>DEFAULT</maven.plugin.validation>
        <maven-core.version>3.9.4</maven-core.version>
        <maven-plugin-api.version>3.9.4</maven-plugin-api.version>
        <maven-plugin-plugin.version>3.9.0</maven-plugin-plugin.version>
        <maven-plugin-annotations.version>3.9.0</maven-plugin-annotations.version>
        <maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>

        <license-maven-plugin.version>2.2.0</license-maven-plugin.version>
        <maven-source-plugin.version>3.3.0</maven-source-plugin.version>
        <maven-javadoc-plugin.version>3.4.1</maven-javadoc-plugin.version>
        <maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
        <gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
        <!-- Maven3.9+ 新特性-插件验证 https://maven.apache.org/guides/plugins/validation/index.html-->
<!--        <maven.plugin.validation>VERBOSE</maven.plugin.validation>-->
    </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>${roaster-jdt.version}</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>-->
        <!--            <scope>test</scope>-->
        <!--            <version>3.0.2</version>-->
        <!--        </dependency>-->

        <!-- MVN plugin standard dependency; maven inner dependency, warning without provided. -->
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${maven-plugin-api.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>${maven-core.version}</version>
            <scope>provided</scope>
        </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, version2 |
                            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>${maven-compiler-plugin.version}</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>${maven-plugin-plugin.version}</version>
                <configuration>
                    <!-- 或者在类的注视上添加一个descriptor -->
                    <!-- Needed for Java 5 annotation based configuration, for some reason. -->
                    <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
                </configuration>
            </plugin>

        </plugins>
    </build>

</project>