<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>io.github.maidsg</groupId>
  <artifactId>demo-library</artifactId>
  <version>0.0.1</version>
  <packaging>jar</packaging>
  <name>demo-library</name>
  <description>A demo library for testing Central Portal publishing</description>
  <url>https://github.com/MaidSG/demo-library</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <maven.compiler.source>21</maven.compiler.source>
    <maven.compiler.target>21</maven.compiler.target>
  </properties>

  <!-- 必须的许可证声明 -->
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <!-- 开发者信息 -->
  <developers>
    <developer>
      <name>WangYu</name>
      <email>ifinetoo@qq.com</email>
      <organization>MaidSG</organization>
    </developer>
  </developers>

  <!-- SCM 配置 -->
  <scm>
    <connection>scm:git:git://github.com/MaidSG/demo-library.git</connection>
    <developerConnection>scm:git:ssh://github.com/MaidSG/demo-library.git</developerConnection>
    <url>https://github.com/MaidSG/demo-library</url>
  </scm>

  <distributionManagement>
    <repository>
      <id>central</id>
      <url>https://central.sonatype.com/</url>
    </repository>
  </distributionManagement>

  <build>
    <plugins>
      <!-- Central Portal 官方插件 -->
      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
        <version>0.7.0</version>
        <extensions>true</extensions>
        <configuration>
          <publishingServerId>central</publishingServerId>
        </configuration>
      </plugin>

      <!-- 强制要求：源码生成插件 -->
      <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.5.0</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals><goal>jar</goal></goals>
          </execution>
        </executions>
      </plugin>

      <!-- 强制要求：GPG 签名插件 -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>verify</phase>
            <goals><goal>sign</goal></goals>
            <configuration>
              <keyname>0x0DB89D1E</keyname>
              <passphraseServerId>0x0DB89D1E</passphraseServerId>
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
