<?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>tw.com.softleader.data</groupId>
  <artifactId>specification-mapper-parent</artifactId>
  <version>1.0.1</version>
  <packaging>pom</packaging>

  <name>specification-mapper-parent</name>
  <description>Specification binding API for Spring Data JPA</description>
  <url>https://github.com/softleader/specification-mapper</url>
  <inceptionYear>2022</inceptionYear>
  <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>Matt Ho</name>
      <email>matt.ho@softleader.com.tw</email>
    </developer>
  </developers>
  <organization>
    <name>SoftLeader</name>
    <url>http://www.softleader.com.tw</url>
  </organization>
  <scm>
    <url>https://github.com/softleader/specification-mapper</url>
		<connection>scm:git:git://github.com/softleader/specification-mapper.git</connection>
		<developerConnection>scm:git:ssh://git@github.com/oftleader/specification-mapper.git</developerConnection>
  </scm>

  <properties>
    <!-- Basics -->
    <java.version>11</java.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <!-- Plugins -->
    <maven-compiler-plugin.version>3.9.0</maven-compiler-plugin.version>
    <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
    <formatter-maven-plugin.version>2.17.1</formatter-maven-plugin.version>
    <maven-source-plugin.version>3.2.0</maven-source-plugin.version>
    <maven-javadoc-plugin.version>3.3.1</maven-javadoc-plugin.version>
    <maven-site-plugin.version>3.8.2</maven-site-plugin.version>
    <license-maven-plugin.version>4.1</license-maven-plugin.version>
    <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>

    <spring-boot.version>2.6.3</spring-boot.version>
    <findbugs.version>3.0.1</findbugs.version>
    <format.skip>false</format.skip>
  </properties>

  <modules>
    <module>mapper</module>
    <module>starter</module>
  </modules>

  <pluginRepositories>
    <pluginRepository>
      <id>jcenter-snapshots</id>
      <url>http://oss.jfrog.org/artifactory/oss-snapshot-local/</url>
    </pluginRepository>
    <pluginRepository>
      <id>jcenter-releases</id>
      <url>http://jcenter.bintray.com</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>

  <distributionManagement>
    <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>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${spring-boot.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <repositories>
    <repository>
      <id>spring-milestones</id>
      <url>https://repo.spring.io/milestone</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>spring-release</id>
      <url>https://repo.spring.io/release</url>
    </repository>
  </repositories>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <version>${spring-boot.version}</version>
        </plugin>
        <plugin>
          <groupId>net.revelc.code.formatter</groupId>
          <artifactId>formatter-maven-plugin</artifactId>
          <version>${formatter-maven-plugin.version}</version>
          <configuration>
            <configFile>${maven.multiModuleProjectDirectory}/ide-config/eclipse-format.xml
            </configFile>
            <skip>${format.skip}</skip>
          </configuration>
          <executions>
            <execution>
              <phase>process-sources</phase>
              <goals>
                <goal>format</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>${license-maven-plugin.version}</version>
          <configuration>
            <licenseSets>
              <licenseSet>
                <header>copyright-license-header-template.txt</header>
                <excludes>
                  <exclude>**/README</exclude>
                  <exclude>.editorconfig</exclude>
                  <exclude>Makefile</exclude>
                  <exclude>Jenkinsfile*</exclude>
                  <exclude>ide-config/**</exclude>
                  <exclude>**/*.xml</exclude>
                  <exclude>src/test/resources/**</exclude>
                  <exclude>src/main/resources/**</exclude>
                </excludes>
              </licenseSet>
            </licenseSets>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>format</goal>
              </goals>
              <phase>process-sources</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven-compiler-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven-surefire-plugin.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>${maven-source-plugin.version}</version>
            <configuration>
              <attach>true</attach>
            </configuration>
            <executions>
              <execution>
                <id>package</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${maven-javadoc-plugin.version}</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <quiet>true</quiet>
                  <doclint>none</doclint>
                  <show>package</show>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
            <version>${maven-site-plugin.version}</version>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven-gpg-plugin.version}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <keyname>${gpg.keyname}</keyname>
                  <passphraseServerId>${gpg.keyname}</passphraseServerId>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <reporting>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${maven-javadoc-plugin.version}</version>
            <configuration>
              <quiet>true</quiet>
              <doclint>none</doclint>
              <show>package</show>
            </configuration>
          </plugin>
        </plugins>
      </reporting>
    </profile>
  </profiles>

</project>
