<?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>cn.ponfee</groupId>
  <artifactId>hello-world</artifactId>
  <version>${revision}</version>

  <!-- 发布到中央仓库的参考文章：
    https://central.sonatype.org/publish/requirements/#supported-code-hosting-services-for-personal-groupid
    https://liuyanzhao.com/1500353647236747264.html
    https://blog.csdn.net/qq_42651904/article/details/121191238

    命令：mvn clean deploy -Drevision=1.0 -DskipTests -Dcheckstyle.skip -U
    注意：使用“mvnw”命令需要确认“~/.m2”目录下是否有settings.xml文件且正确配置server元素
  -->
  <name>Hello World</name>
  <description>Hello World</description>
  <url>https://github.com/ponfee/hello-world</url>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Ponfee</name>
      <email>ponfee.cn@gmail.com</email>
      <organization>ponfee.cn</organization>
      <organizationUrl>http://www.ponfee.cn/</organizationUrl>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:git://github.com/ponfee/hello-world.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/ponfee/hello-world.git</developerConnection>
    <url>https://github.com/ponfee/hello-world.git</url>
    <tag>master</tag>
  </scm>
  <!-- 根据version中是否带有“-SNAPSHOT”来判断是分发到snapshots库还是releases库 -->
  <distributionManagement>
    <!-- 添加到maven的安装目录的settings.xml中
    <servers>
      <server>
        <id>ossrh</id>
        <username>username</username>
        <password>password</password>
      </server>
    </servers> -->
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <properties>
    <file.encoding>UTF-8</file.encoding>
    <java.version>1.8</java.version>
    <project.build.sourceEncoding>${file.encoding}</project.build.sourceEncoding>
    <project.reporting.outputEncoding>${file.encoding}</project.reporting.outputEncoding>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <maven.compiler.compilerVersion>${java.version}</maven.compiler.compilerVersion>
    <revision>1.0</revision>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <!-- 1、“https://repo1.maven.org/maven2”与“https://repo.maven.apache.org/maven2”是同一个仓库(central，即mavenCentral)
           2、central是在“$MAVEN_HOME/lib/maven-model-builder.jar!/org/apache/maven/model/pom-4.0.0.xml”中配置的
           3、central仓的镜像：https://maven.aliyun.com/repository/central
           4、central仓和jcenter仓的聚合镜像仓：https://maven.aliyun.com/repository/public
           5、搜索地址：https://search.maven.org/
           6、文档：https://developer.aliyun.com/mvn/guide
      -->
      <id>central</id>
      <url>https://repo.maven.apache.org/maven2</url>
    </repository>
    <!--<repository>
      2022-02-01后jcenter不再支持下载(已停用)
      <id>jcenter</id>
      <url>https://jcenter.bintray.com</url>
    </repository>-->
    <repository>
      <id>nexus.nuiton.org-central</id>
      <url>https://nexus.nuiton.org/nexus/content/repositories/central</url>
    </repository>
    <repository>
      <id>nexus.nuiton.org-thirdparty</id>
      <url>https://nexus.nuiton.org/nexus/content/repositories/thirdparty</url>
    </repository>
  </repositories>

  <build>
    <finalName>${project.artifactId}-${project.version}</finalName>

    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>false</filtering>
      </resource>
      <resource>
        <!--mybatis xml-->
        <directory>src/main/java</directory>
        <includes>
          <include>**/*.xml</include>
        </includes>
        <filtering>false</filtering>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>false</filtering>
      </testResource>
    </testResources>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.10.1</version>
        <configuration>
          <source>${maven.compiler.source}</source>
          <target>${maven.compiler.target}</target>
          <encoding>${file.encoding}</encoding>
          <compilerArgument>-Xlint:unchecked,deprecation</compilerArgument>
        </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>
            <phase>verify</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.4.1</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <doclint>none</doclint>
        </configuration>
      </plugin>
      <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>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.3.0</version>
        <configuration>
          <encoding>${file.encoding}</encoding>
        </configuration>
      </plugin>
    </plugins>

  </build>

</project>
