<?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>love.forte</groupId>
    <artifactId>catcode</artifactId>
    <version>1.0.0-BETA.1</version>

    <name>catcode</name>

    <scm>
        <url>https://github.com/ForteScarlet/CatCode</url>
    </scm>

    <url>https://github.com/ForteScarlet/CatCode</url>

    <description>猫猫码，一个可爱的通用特殊码。/ Cat code, the spirit of CQ code continues, a cute universal special code.

    </description>

    <properties>
        <!-- kt version -->
        <kotlin.version>1.4.30-M1</kotlin.version>
        <!-- dokka version -->
        <dokka.version>1.4.0-rc</dokka.version>
    </properties>

    <dependencies>
        <!--<editor-fold desc="kotlin">-->
        <!-- kt -->
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
            <version>${kotlin.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib-jdk8</artifactId>
            <version>${kotlin.version}</version>
        </dependency>

        <!-- kt test -->
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-test</artifactId>
            <version>${kotlin.version}</version>
            <scope>test</scope>
        </dependency>
        <!--</editor-fold>-->
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.jetbrains.dokka</groupId>
                <artifactId>dokka-maven-plugin</artifactId>
                <!--<version>1.3.9</version>-->
                <version>${dokka.version}</version>
                <executions>
                    <execution>
                        <phase>install</phase>
                        <goals>
                            <!--<goal>dokka</goal>-->
                            <!--<goal>javadoc</goal>-->
                            <goal>javadocJar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <jdkVersion>8</jdkVersion>
                    <skipEmptyPackages>true</skipEmptyPackages>
                    <reportUndocumented>false</reportUndocumented>
                    <skipDeprecated>true</skipDeprecated>
                    <cacheRoot>default</cacheRoot>
                    <offlineMode>true</offlineMode>
                </configuration>
            </plugin>
            <!-- compiler plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <executions>
                    <!-- 替换会被 maven 特别处理的 default-compile -->
                    <execution>
                        <id>default-compile</id>
                        <phase>none</phase>
                    </execution>
                    <!-- 替换会被 maven 特别处理的 default-testCompile -->
                    <execution>
                        <id>default-testCompile</id>
                        <phase>none</phase>
                    </execution>
                    <execution>
                        <id>java-compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>java-test-compile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <compilerArgs>
                        <arg>-parameters</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <!-- java源码 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <attach>true</attach>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- kt maven -->
            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <version>${kotlin.version}</version>
                <executions>
                    <execution>
                        <id>compile</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!-- kotlinOptions.freeCompilerArgs = ['-Xjvm-default=enable'] -->
                    <args>
                        <!--<arg>-Xjvm-default=enable</arg>-->
                        <arg>-Xjvm-default=all</arg>
                        <arg>-Xinline-classes</arg>
                    </args>
                    <jvmTarget>1.8</jvmTarget>
                </configuration>
            </plugin>


            <!-- maven仓库相关插件 -->
            <!-- (1) deploy插件 -->
            <plugin>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
                <executions>
                    <execution>
                        <id>default-deploy</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- （2）sonatype的staging插件 -->
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.7</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>oss</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <!-- （3）SCM插件 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-plugin</artifactId>
                <version>1.8.1</version>
            </plugin>
            <!-- （4）release插件，下面checkModificationExcludes是排除一些目录文件不要发布。 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <mavenExecutorId>forked-path</mavenExecutorId>
                    <useReleaseProfile>false</useReleaseProfile>
                    <arguments>-Psonatype-oss-release</arguments>
                    <pushChanges>false</pushChanges>
                    <localCheckout>false</localCheckout>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <checkModificationExcludes>
                        <checkModificationExclude>.idea/</checkModificationExclude>
                        <checkModificationExclude>.idea/*</checkModificationExclude>
                        <checkModificationExclude>test/</checkModificationExclude>
                        <checkModificationExclude>test/*</checkModificationExclude>
                        <checkModificationExclude>.idea/libraries/*</checkModificationExclude>
                        <checkModificationExclude>pom.xml</checkModificationExclude>
                        <checkModificationExclude>release-pom.xml</checkModificationExclude>

                        <checkModificationExclude>jdonframework.iml</checkModificationExclude>
                        <checkModificationExclude>JdonAccessory/jdon-hibernate3x/jdon-hibernate3x.iml
                        </checkModificationExclude>
                        <checkModificationExclude>JdonAccessory/jdon-jdbc/jdon-jdbc.iml</checkModificationExclude>
                        <checkModificationExclude>JdonAccessory/jdon-remote/jdon-remote.iml</checkModificationExclude>
                        <checkModificationExclude>JdonAccessory/jdon-struts1x/jdon-struts1x.iml
                        </checkModificationExclude>
                    </checkModificationExcludes>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-scm-plugin</artifactId>
                        <version>1.8.1</version>
                    </dependency>
                </dependencies>
            </plugin>
            <!-- GPG
            第3步：进行GPG签名加密，
            这是对生成的jar包，javadoc包等进行签名加密，
            保证你的文件上传到服务器过程中不会被拦截和破解安全，服务器那边使用你提供的密钥对进行解密。
            在pom.xml的build一级目录下的plugins里面加入下面：
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>install</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <pluginRepositories>
        <pluginRepository>
            <id>jcenter</id>
            <name>JCenter</name>
            <url>https://jcenter.bintray.com/</url>
        </pluginRepository>
    </pluginRepositories>

    <!-- licenses -->
    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://opensource.org/licenses/MIT</url>
        </license>
    </licenses>


    <!-- developers -->
    <developers>
        <developer>
            <roles>
                <role>a single programmer</role>
            </roles>
            <name>ForteScarlet</name>
            <email>ForteScarlet@163.com</email>
        </developer>
    </developers>


    <distributionManagement>
        <snapshotRepository>
            <id>oss</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>oss</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.7</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>oss</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>