<?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>

    <!-- 你的 Maven 坐标（和你验证通过的 Namespace 一致） -->
    <groupId>io.github.lyh19940304</groupId>
    <artifactId>code-generator</artifactId>
    <version>1.0.4</version>
    <packaging>jar</packaging>

    <!-- 项目基础信息（中央仓库必须） -->
    <name>lyh-code-generator</name>
    <description>个人自用Java后端代码生成工具，支持垂直分包、自定义表过滤、实体类命名转换，适配自研全套开发规范</description>
    <url>https://github.com/lyh19940304/code-generator</url>

    <!-- 许可证（推荐 Apache 2.0） -->
    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>

    <!-- 开发者信息（填你自己的） -->
    <developers>
        <developer>
            <id>lyh19940304</id>
            <name>刘一辉</name>
            <email>lyh19940304@163.com</email>
        </developer>
    </developers>

    <!-- 源码仓库信息（必填） -->
    <scm>
        <connection>scm:git:git@github.com:lyh19940304/code-generator.git</connection>
        <developerConnection>scm:git:git@github.com:lyh19940304/code-generator.git</developerConnection>
        <url>https://github.com/lyh19940304/code-generator</url>
    </scm>

    <!-- 基础配置 -->
    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <!-- 依赖配置（全部加 optional=true，不传递依赖） -->
    <dependencies>
        <!-- Freemarker 模板引擎 -->
        <dependency>
            <groupId>org.freemarker</groupId>
            <artifactId>freemarker</artifactId>
            <version>2.3.32</version>
            <optional>true</optional>
        </dependency>

        <!-- MySQL 驱动（仅你本地测试用，用户自己引） -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.33</version>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.30</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>

    </dependencies>

    <!-- 构建配置（中央仓库强制要求源码、javadoc、签名） -->
    <build>
        <plugins>
            <!-- 源码打包 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <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.5.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <failOnError>false</failOnError>
                    <failOnWarnings>false</failOnWarnings>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.1.4</version>
            </plugin>

            <!-- 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>

            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.5.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <autoPublish>true</autoPublish>  <!-- 手动发布，或设为 true 自动发布 -->
                </configuration>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <repository>
            <id>central</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
</project>