<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>cn.ryeme.zero</groupId>
  <artifactId>zero-parent</artifactId>
  <version>0.1.1</version>
  <packaging>pom</packaging>

  <name>zero</name>
  <description>Common Module Based on Spring Boot</description>
  <url>https://github.com/ryeme/zero</url>

  <modules>
    <module>zero-common</module>
  </modules>

  <properties>
    <!-- project config -->
    <java.version>17</java.version>
    <compile.version>17</compile.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <Automatic-Module-Name>cn.ryeme.zero</Automatic-Module-Name>

    <!-- dependency version -->
    <lombok.version>1.18.38</lombok.version>
  </properties>

  <dependencyManagement>
  </dependencyManagement>

  <dependencies>
    <!-- tools -->
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>${lombok.version}</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>

  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://opensource.org/licenses/MIT</url>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>River Liu</name>
      <email>ljathit@gmail.com</email>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:git://github.com/ryeme/zero.git</connection>
    <developerConnection>scm:git:ssh://github.com:ryeme/zero.git</developerConnection>
    <url>https://github.com/ryeme/zero/tree/main</url>
  </scm>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.13.0</version>
        <configuration>
          <source>${compile.version}</source>
          <target>${compile.version}</target>
          <compilerArgument>-Xlint:unchecked</compilerArgument>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.5.3</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.4.2</version>
        <configuration>
          <archive>
            <index>true</index>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
            <manifestEntries>
              <Build-OS>${os.name}</Build-OS>
              <Built-By>${user.name}</Built-By>
              <Build-Jdk>${java.version}</Build-Jdk>
              <Build-Timestamp>${maven.build.timestamp}</Build-Timestamp>
              <Automatic-Module-Name>${Automatic-Module-Name}</Automatic-Module-Name>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>

    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <distributionManagement>
        <snapshotRepository>
          <id>central</id>
          <url>https://central.sonatype.com/api/v1/publisher/deployments/upload/</url>
        </snapshotRepository>
        <repository>
          <id>central</id>
          <url>https://central.sonatype.com/api/v1/publisher/deployments/upload/</url>
        </repository>
      </distributionManagement>
      <build>
        <plugins>
          <!-- Source -->
          <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.6.0</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals><goal>jar</goal></goals>
              </execution>
            </executions>
          </plugin>

          <!-- Gpg Signature -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.1.0</version>
            <executions>
              <execution>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </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>false</autoPublish>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
