<?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>fun.ceroxe.api</groupId>
    <artifactId>ceroxe-parent</artifactId>
    <version>0.2.5</version> <!-- 已修正为 0.2.5 -->
    <packaging>pom</packaging>

    <!-- ============================================================ -->
    <!-- 1. Maven Central 必须的元数据 (Metadata) -->
    <!-- ============================================================ -->
    <name>CeroxeAPI</name>
    <description>A versatile Java utility library for personal and community use.</description>
    <url>https://github.com/CeroxeAnivie/CeroxeAPI</url>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://opensource.org/licenses/MIT</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Ceroxe</name>
            <email>1591117599@qq.com</email>
            <organization>Ceroxe</organization>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/CeroxeAnivie/CeroxeAPI.git</connection>
        <developerConnection>scm:git:ssh://github.com:CeroxeAnivie/CeroxeAPI.git</developerConnection>
        <url>https://github.com/CeroxeAnivie/CeroxeAPI</url>
    </scm>

    <properties>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <ceroxe.version>0.2.5</ceroxe.version> <!-- 统一版本变量 -->
    </properties>

    <modules>
        <module>ceroxe-core</module>
        <module>ceroxe-detector</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <!-- 自己的 Core 模块版本 -->
            <dependency>
                <groupId>fun.ceroxe.api</groupId>
                <artifactId>ceroxe-core</artifactId>
                <version>${ceroxe.version}</version>
            </dependency>
            <!-- 第三方库版本管理 -->
            <dependency>
                <groupId>org.jline</groupId>
                <artifactId>jline</artifactId>
                <version>3.27.1</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <!-- ======================================================= -->
            <!-- 关键修正：禁用 Maven 默认的 Deploy 插件 -->
            <!-- 解决 Deployment failed: repository element was not specified 报错 -->
            <!-- ======================================================= -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.1.2</version>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>

            <!-- 编译插件 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
                <configuration>
                    <source>21</source>
                    <target>21</target>
                    <compilerArgs>--enable-preview</compilerArgs>
                </configuration>
            </plugin>

            <!-- ============================================================ -->
            <!-- 2. Maven Central 必须的构建插件 (Plugins) -->
            <!-- ============================================================ -->

            <!-- (A) 源码包插件 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- (B) Javadoc插件 (已配置忽略错误) -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.6.3</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <failOnError>false</failOnError>
                    <doclint>none</doclint>
                </configuration>
            </plugin>

            <!-- (C) GPG 签名插件 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- (D) 新版中央仓库发布插件 -->
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.3.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <tokenAuth>true</tokenAuth>
                    <autoPublish>true</autoPublish>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>