<?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>neta-parent</artifactId>
    <version>1.2.0</version>
    <packaging>pom</packaging>

    <!-- Project Info -->
    <name>Neta Parent</name>
    <description>Java AIO Network utils</description>
    <url>https://www.hasor.net/</url>
    <inceptionYear>2022</inceptionYear>

    <properties>
        <downloadSources>true</downloadSources>
        <downloadJavadocs>true</downloadJavadocs>
        <jacoco.version>0.8.12</jacoco.version>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
        <!--<maven.test.skip>true</maven.test.skip>-->
        <!--<skipTests>true</skipTests>-->
    </properties>

    <!-- 授权协议 -->
    <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@gitee.com:zycgit/neta.git</connection>
        <developerConnection>scm:git:git@gitee.com:zycgit/neta.git</developerConnection>
        <url>https://gitee.com/zycgit/neta</url>
        <tag>v1.2.0</tag>
    </scm>

    <developers>
        <developer>
            <name>赵永春(Mr.Zhao)</name>
            <email>zyc@hasor.net</email>
        </developer>
    </developers>

    <modules>
        <module>neta-all</module>
        <module>neta-core</module>
        <module>neta-codec-http</module>
        <!-- <module>neta-codec-mail</module>-->
        <module>neta-codec-net</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>net.hasor</groupId>
                <artifactId>neta-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>net.hasor</groupId>
                <artifactId>neta-codec-http</artifactId>
                <version>${project.version}</version>
            </dependency>
            <!--            <dependency>-->
            <!--                <groupId>net.hasor</groupId>-->
            <!--                <artifactId>neta-codec-mail</artifactId>-->
            <!--                <version>${project.version}</version>-->
            <!--            </dependency>-->
            <dependency>
                <groupId>net.hasor</groupId>
                <artifactId>neta-codec-net</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>net.hasor</groupId>
                <artifactId>cobble-all</artifactId>
                <version>4.8.6</version>
            </dependency>

            <!-- for Test -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.13.2</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <!-- 构建描述 -->
    <build>
        <plugins>
            <!-- Compile -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.14.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.11.3</version>
                <configuration>
                    <failOnError>false</failOnError>
                    <failOnWarnings>false</failOnWarnings>
                    <doclint>none</doclint>
                    <!-- Suppress "packages in unnamed module" warning that appears when
                         javadoc auto-links to the Java 8 API while the project uses JPMS. -->
                    <detectJavaApiLink>false</detectJavaApiLink>
                    <!-- Explicitly tell javadoc the source level so it never falls back to -1.1 -->
                    <source>8</source>
                    <additionalJOption>--allow-script-in-comments</additionalJOption>
                    <encoding>UTF-8</encoding>
                    <docencoding>UTF-8</docencoding>
                    <outputDirectory>${project.build.directory}</outputDirectory>
                </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.3.1</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <!-- test 失败继续 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <testFailureIgnore>true</testFailureIgnore>
                    <!-- <argLine>&#45;&#45;add-modules=jdk.unsupported</argLine>-->
                    <!-- <argLine>&#45;&#45;add-opens=java.base/java.lang=ALL-UNNAMED</argLine>-->
                    <!-- <argLine>&#45;&#45;add-opens=java.base/sun.nio.ch=ALL-UNNAMED</argLine>-->
                    <!-- <argLine>&#45;&#45;add-opens=java.base/java.lang.reflect=ALL-UNNAMED</argLine>-->
                    <!-- <argLine>&#45;&#45;add-opens=java.base/java.io=ALL-UNNAMED</argLine>-->
                    <!-- <argLine>&#45;&#45;add-opens=java.base/java.net=ALL-UNNAMED</argLine>-->
                </configuration>
            </plugin>
            <!-- 覆盖率 -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</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>

    <profiles>
        <!-- 使用“-P release”启用下面配置 -->
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- GPG -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.8</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- publishing -->
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.8.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-release-plugin</artifactId>
                        <version>3.1.1</version>
                        <configuration>
                            <autoVersionSubmodules>true</autoVersionSubmodules>
                            <useReleaseProfile>false</useReleaseProfile>
                            <releaseProfiles>release</releaseProfiles>
                            <tagNameFormat>v@{project.version}</tagNameFormat>
                            <goals>deploy</goals>
                            <preparationGoals>clean dependency:purge-local-repository verify</preparationGoals>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!-- 在开发中增加测试工程 -->
        <profile>
            <id>dev</id>
            <modules>
                <module>neta-example</module>
                <module>performance</module>
            </modules>
        </profile>
        <profile>
            <id>tests</id>
            <modules>
                <module>neta-example</module>
                <module>performance</module>
                <module>neta-lab</module>
            </modules>
        </profile>
    </profiles>
</project>