<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <!-- Maven Info -->
    <modelVersion>4.0.0</modelVersion>
    <groupId>net.hasor</groupId>
    <artifactId>cobble-parent</artifactId>
    <version>4.6.4</version>
    <packaging>pom</packaging>

    <!-- 项目信息 -->
    <name>Cobble Parent</name>
    <description>java utils</description>
    <url>https://www.hasor.net/</url>
    <inceptionYear>2022</inceptionYear>

    <!-- 授权协议 -->
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <!-- SCM -->
    <scm>
        <connection>scm:git:git@git.oschina.net:zycgit/cobble.git</connection>
        <developerConnection>scm:git:git@git.oschina.net:zycgit/cobble.git</developerConnection>
        <url>git@git.oschina.net:zycgit/cobble.git</url>
        <tag>Release.Cobble-4.6.4</tag>
    </scm>

    <!-- 开发者 -->
    <developers>
        <developer>
            <name>赵永春(Mr.Zhao)</name>
            <email>zyc@hasor.net</email>
        </developer>
    </developers>

    <modules>
        <module>cobble-all</module>
        <module>cobble-lang</module>
        <module>cobble-loader</module>
        <module>cobble-dynamic</module>
        <module>cobble-settings</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>net.hasor</groupId>
                <artifactId>cobble-lang</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>net.hasor</groupId>
                <artifactId>cobble-dynamic</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>net.hasor</groupId>
                <artifactId>cobble-settings</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>net.hasor</groupId>
                <artifactId>cobble-loader</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>org.ow2.asm</groupId>
                <artifactId>asm</artifactId>
                <version>9.5</version>
            </dependency>
            <dependency>
                <groupId>org.yaml</groupId>
                <artifactId>snakeyaml</artifactId>
                <version>2.2</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <!-- 公共依赖 -->
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <!-- 构建描述 -->
    <build>
        <plugins>
            <!-- Compile -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF8</encoding>
                </configuration>
            </plugin>
            <!-- Source -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Javadoc -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <failOnError>false</failOnError>
                    <failOnWarnings>false</failOnWarnings>
                    <doclint>none</doclint>
                    <additionalJOption>--allow-script-in-comments</additionalJOption>
                    <excludePackageNames>net.hasor.cobble.asm.*,net.hasor.cobble.setting.provider.yaml.lib.*
                    </excludePackageNames>
                    <encoding>UTF-8</encoding>
                    <docencoding>UTF-8</docencoding>
                    <!-- <header><![CDATA[ [<a target="_blank" href="http://www.hasor.net">Web Site</a>] ]]></header>-->
                    <!-- <bottom>${javadocs.bottom}</bottom>-->
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- resources -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <!-- 覆盖率 -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.5</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <outputDirectory>${project.basedir}/target/jacoco-ut</outputDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <!-- 使用“-P release”启用下面配置 -->
    <profiles>
        <profile>
            <id>release</id>
            <properties>
                <gpg.executable>gpg2</gpg.executable>
                <gpg.passphrase>fubing220106</gpg.passphrase>
            </properties>
            <build>
                <plugins>
                    <!-- 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>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.7</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-release-plugin</artifactId>
                        <version>2.5.3</version>
                        <configuration>
                            <autoVersionSubmodules>true</autoVersionSubmodules>
                            <useReleaseProfile>false</useReleaseProfile>
                            <releaseProfiles>release</releaseProfiles>
                            <tagNameFormat>Release.Cobble-@{project.version}</tagNameFormat>
                            <goals>deploy</goals>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jdk-1.8</id>
            <activation>
                <jdk>1.8</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>3.1.2</version>
                        <configuration>
                            <testFailureIgnore>true</testFailureIgnore>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jdk-default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <jdk>!1.8</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>3.1.2</version>
                        <configuration>
                            <testFailureIgnore>true</testFailureIgnore>
                            <argLine>--add-opens=java.base/java.lang=ALL-UNNAMED</argLine>
                            <argLine>--add-opens=java.base/java.lang.reflect=ALL-UNNAMED</argLine>
                            <argLine>--add-opens=java.base/java.io=ALL-UNNAMED</argLine>
                            <argLine>--add-opens=java.base/java.net=ALL-UNNAMED</argLine>
                            <!-- <argLine>&#45;&#45;add-opens=jdk.unsupported=ALL-UNNAMED</argLine>-->
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>