<?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>
    <packaging>pom</packaging>

    <groupId>com.iohao.net</groupId>
    <artifactId>ionet</artifactId>
    <version>25.2</version>
    <name>ionet</name>

    <description>
        A Java distributed server framework based on Aeron and Netty, featuring lock-free asynchronous and event-driven
        architecture design.
        For Java distributed network communication with nanosecond end-to-end latency, ionet is the choice.

        基于 Aeron、Netty 的 java 分布式服务器框架，无锁异步化、事件驱动架构设计。
        java 分布式网络通信，纳秒级端到端延迟就选 ionet。
    </description>
    <url>https://iohao.github.io/ionet</url>
    <modules>
        <module>common-kit</module>
        <module>core-framework</module>

        <module>net-common</module>
        <module>net-center</module>
        <module>net-server</module>
        <module>net-logic-server</module>
        <module>external-core</module>
        <module>external-netty</module>
        <module>run-one</module>

        <module>extension-client</module>
        <module>extension-domain-event</module>
        <module>extension-jprotobuf</module>
        <module>extension-room</module>
        <module>extension-codegen</module>
        <module>extension-spring</module>
    </modules>

    <properties>
        <java.version>25</java.version>
        <maven.compiler.source>25</maven.compiler.source>
        <maven.compiler.target>25</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- https://mvnrepository.com/artifact/io.aeron/aeron-all -->
        <aeron.version>1.49.2</aeron.version>
        <!-- https://mvnrepository.com/artifact/io.netty/netty-all -->
        <netty.version>4.2.7.Final</netty.version>
        <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
        <slf4j-api.version>2.0.17</slf4j-api.version>

        <!--  https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter  -->
        <junit.version>6.0.1</junit.version>

        <!-- https://mvnrepository.com/artifact/com.baidu/jprotobuf -->
        <jprotobuf.version>2.4.23</jprotobuf.version>
        <!-- https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java -->
        <protobuf-java.version>4.33.1</protobuf-java.version>
        <!-- https://mvnrepository.com/artifact/com.lmax/disruptor -->
        <disruptor.version>4.0.0</disruptor.version>

        <!-- https://mvnrepository.com/artifact/org.fusesource.jansi/jansi  -->
        <jansi.version>2.4.2</jansi.version>
        <!-- https://mvnrepository.com/artifact/com.thoughtworks.qdox/qdox -->
        <qdox.version>2.2.0</qdox.version>

        <!-- JSR-380 https://mvnrepository.com/artifact/jakarta.validation/jakarta.validation-api -->
        <jakarta.validation-api.version>3.1.1</jakarta.validation-api.version>
        <!-- https://mvnrepository.com/artifact/ch.qos.logback/logback-classic -->
        <logback.version>1.5.21</logback.version>
        <!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
        <lombok.version>1.18.42</lombok.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>io.aeron</groupId>
            <artifactId>aeron-all</artifactId>
            <version>${aeron.version}</version>
        </dependency>

        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>${protobuf-java.version}</version>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.jspecify</groupId>
            <artifactId>jspecify</artifactId>
            <version>1.0.0</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j-api.version}</version>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <issueManagement>
        <system>Github Issue</system>
        <url>https://github.com/iohao/ionet/issues</url>
    </issueManagement>

    <licenses>
        <license>
            <name>GNU Affero General Public License v3.0</name>
            <url>https://www.gnu.org/licenses/agpl-3.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>渔民小镇</name>
            <id>luoyizhu@gmail.com</id>
            <email>luoyizhu@gmail.com</email>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/iohao/ionet</url>
        <connection>scm:git:https://github.com/iohao/ionet.git</connection>
        <developerConnection>scm:git:https://github.com/iohao/ionet.git</developerConnection>
    </scm>

    <build>
        <plugins>
            <!--
            https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-javadoc-plugin
            mvnd clean javadoc:aggregate
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.12.0</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <charset>UTF-8</charset>
                    <docencoding>UTF-8</docencoding>
                    <failOnError>false</failOnError>
                    <additionalOptions>-Xdoclint:none</additionalOptions>
                    <tags>
                        <tag>
                            <name>date</name>
                            <placement>a</placement>
                            <head>date:</head>
                        </tag>
                    </tags>
                </configuration>
            </plugin>

            <!-- 打包源码 https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-source-plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.4.0</version>
                <configuration>
                    <attach>true</attach>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- 打包时跳过单元测试 https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin -->
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.5.4</version>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>3.5.3</version>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>


            <!--
            编译插件
            mvn compile
            To compile your test sources, you'll do:
            mvn test-compile
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.14.1</version>
                <configuration>
                    <compilerVersion>${java.version}</compilerVersion>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <parameters>true</parameters>
                    <skip>true</skip>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>${lombok.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>

            <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-jar-plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.5.0</version>
                <configuration>
                    <archive>
                        <index>true</index>
                        <manifest>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            <addBuildEnvironmentEntries>true</addBuildEnvironmentEntries>
                        </manifest>
                        <manifestSections>
                            <manifestSection>
                                <name>zhu luo yi</name>
                                <manifestEntries>
                                    <id>渔民小镇</id>
                                </manifestEntries>
                            </manifestSection>
                        </manifestSections>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>


    <profiles>
        <!-- mvn clean deploy -P oss-release -Dmaven.test.skip=true -e -->
        <profile>
            <id>oss-release</id>

            <build>
                <plugins>
                    <!-- Gpg Signature https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-gpg-plugin -->
                    <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>

                    <!--
                    自动发布 https://mvnrepository.com/artifact/org.sonatype.central/central-publishing-maven-plugin
                    -->
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.9.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                            <waitUntil>published</waitUntil>
                        </configuration>
                    </plugin>

                    <!-- Javadoc -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.12.0</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
                            <doclint>none</doclint>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>