<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>top.cneze</groupId>
  <artifactId>cenze-message-queue-spring-boot-starter</artifactId>
  <version>1.0.2</version>
  <packaging>jar</packaging>

  <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
    <spring-boot.version>2.7.18</spring-boot.version>
    <fastjson.version>1.2.83</fastjson.version>
  </properties>

  <dependencies>
    <!-- 核心：Spring Boot 自动配置 -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-autoconfigure</artifactId>
      <version>${spring-boot.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-configuration-processor</artifactId>
      <version>${spring-boot.version}</version>
      <optional>true</optional>
    </dependency>

    <!-- 必需 -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-jdbc</artifactId>
      <version>${spring-boot.version}</version>
      <scope>provided</scope>
    </dependency>
    <!-- 连接池（仅当启用自定义数据源时需要） -->
    <dependency>
      <groupId>com.zaxxer</groupId>
      <artifactId>HikariCP</artifactId>
      <version>3.4.2</version>
    </dependency>

    <!-- Fastjson -->
    <dependency>
      <groupId>com.alibaba</groupId>
      <artifactId>fastjson</artifactId>
      <version>${fastjson.version}</version>
    </dependency>
  </dependencies>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${spring-boot.version}</version>
        <type>jar</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <name>cenze-message-queue-spring-boot-starter</name>
  <description>cenze mysql message queue jar</description>
  <url>https://gitee.com/qiuchengze</url>
  <scm>
    <url>https://gitee.com/qiuchengze/cenze-message-queue-spring-boot-starter</url>
    <connection>https://gitee.com/qiuchengze/cenze-message-queue-spring-boot-starter.git</connection>
    <developerConnection>https://gitee.com/qiuchengze/cenze-message-queue-spring-boot-starter.git</developerConnection>
  </scm>

  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>chengze</name>
      <email>eric.qjc@163.com</email>
      <url>http://www.cenze.top</url>
    </developer>
  </developers>

  <!-- === 构建配置（关键！）=== -->
  <build>
    <plugins>
      <!-- 1. 生成源码 JAR -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.3.0</version>
        <executions>
          <execution>
            <id>cenze</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- 2. 生成 Javadoc JAR -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.6.3</version>
        <executions>
          <execution>
            <id>cenze</id>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <!-- 可选：跳过错误（仅用于测试） -->
              <!-- <failOnError>false</failOnError> -->
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>cenze</id>
            <phase>verify</phase>
            <goals><goal>sign</goal></goals>
          </execution>
        </executions>
        <configuration>
          <!-- 👇 显式指定 gpg.exe 路径（关键！） -->
          <gpgExecutable>E:/Program Files/GnuPG/bin/gpg.exe</gpgExecutable>
          <!-- 可选：指定密钥 ID（避免“no default key”问题） -->
          <keyname>32FAA9E63B82C8BB</keyname>
        </configuration>
      </plugin>

      <!-- 4. 新版 Sonatype 发布插件（核心！） -->
      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
        <version>0.4.0</version>
        <extensions>true</extensions>
        <configuration>
          <!-- 必须与 settings.xml 中的 server id 一致 -->
          <publishingServerId>cenze</publishingServerId>
          <!-- 启用 Token 认证（新版必须） -->
          <tokenAuth>true</tokenAuth>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
