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

  <!--==================================================
  ==== Core
  ==================================================-->

  <groupId>com.oliveryasuna.beanbag</groupId>
  <artifactId>beanbag-parent</artifactId>
  <version>0.0.1</version>
  <packaging>pom</packaging>

  <modules>
    <module>beanbag-core</module>
    <module>beanbag-value</module>
    <module>beanbag-collection</module>
  </modules>

  <properties>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <junit-jupiter.version>5.9.3</junit-jupiter.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <!--=========================
      ==== Miscellaneous
      =========================-->

      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.12.0</version>
      </dependency>

      <dependency>
        <groupId>com.oliveryasuna</groupId>
        <artifactId>commons-language</artifactId>
        <version>5.5.0</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>${junit-jupiter.version}</version>

      <scope>test</scope>
    </dependency>
  </dependencies>

  <!--==================================================
  ==== Build
  ==================================================-->

  <build>
    <plugins>
      <!--=========================
      ==== Core
      =========================-->

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>3.2.0</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.10.1</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.3.0</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.0.0-M7</version>

        <configuration>
          <trimStackTrace>false</trimStackTrace>
          <enableAssertions>true</enableAssertions>
          <failIfNoTests>false</failIfNoTests>
        </configuration>

        <dependencies>
          <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit-jupiter.version}</version>
          </dependency>
        </dependencies>
      </plugin>

      <!--=========================
      ==== Utilities
      =========================-->

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

        <configuration>
          <quiet>true</quiet>
          <tags>
            <tag>
              <name>apiNote</name>
              <placement>a</placement>
              <head>API Note:</head>
            </tag>

            <tag>
              <name>implSpec</name>
              <placement>a</placement>
              <head>Implementation Requirements:</head>
            </tag>

            <tag>
              <name>implNote</name>
              <placement>a</placement>
              <head>Implementation Note:</head>
            </tag>
          </tags>
        </configuration>

        <executions>
          <execution>
            <id>attach-javadocs</id>

            <phase>verify</phase>

            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.1.0</version>

        <dependencies>
          <dependency>
            <groupId>de.skuzzle.enforcer</groupId>
            <artifactId>restrict-imports-enforcer-rule</artifactId>
            <version>2.1.0</version>
          </dependency>
        </dependencies>

        <executions>
          <execution>
            <id>minimum-maven-version</id>

            <goals>
              <goal>enforce</goal>
            </goals>

            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>3.2.5</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>

          <execution>
            <id>no-dynamic-dependencies</id>

            <goals>
              <goal>enforce</goal>
            </goals>

            <configuration>
              <rules>
                <banDynamicVersions/>
              </rules>
            </configuration>
          </execution>

          <execution>
            <id>no-duplicate-dependencies</id>

            <goals>
              <goal>enforce</goal>
            </goals>

            <configuration>
              <rules>
                <!--                <dependencyConvergence/>-->
                <banDuplicatePomDependencyVersions/>
              </rules>
            </configuration>
          </execution>

          <execution>
            <id>ensure-slf4j</id>

            <phase>process-sources</phase>

            <goals>
              <goal>enforce</goal>
            </goals>

            <configuration>
              <rules>
                <RestrictImports>
                  <reason>Use SLF4J for logging.</reason>
                  <bannedImport>java.util.logging.**</bannedImport>
                </RestrictImports>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>versions-maven-plugin</artifactId>
        <version>2.14.2</version>
      </plugin>
    </plugins>
  </build>

  <reporting/>

  <!--==================================================
  ==== Details
  ==================================================-->

  <name>${project.groupId}:${project.artifactId}</name>
  <description>Beanbag parent.</description>
  <url>https://github.com/oliveryasuna/beanbag</url>
  <inceptionYear>2023</inceptionYear>
  <licenses>
    <license>
      <name>BSD 3-Clause</name>
      <url>https://opensource.org/licenses/BSD-3-Clause</url>
      <comments>Copyright 2021 Oliver Yasuna</comments>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <organization>
    <name>Oliver Yasuna</name>
    <url>https://oliveryasuna.github.io/</url>
  </organization>
  <developers>
    <developer>
      <id>oliver-yasuna</id>

      <name>Oliver Yasuna</name>
      <url>https://oliveryasuna.github.io/</url>

      <timezone>America/New_York</timezone>
    </developer>
  </developers>
  <contributors/>

  <!--==================================================
  ==== Environment
  ==================================================-->

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/oliveryasuna/beanbag/issues</url>
  </issueManagement>
  <ciManagement/>

  <mailingLists/>

  <scm>
    <url>https://github.com/oliveryasuna/beanbag</url>
    <connection>scm:git:git://github.com/oliveryasuna/beanbag.git</connection>
    <developerConnection>scm:git:git://github.com/oliveryasuna/beanbag.git</developerConnection>
  </scm>

  <repositories/>
  <pluginRepositories/>

  <distributionManagement/>

  <profiles>
    <profile>
      <id>package-sources</id>

      <build>
        <plugins>
          <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>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>package-javadocs</id>

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.3.0</version>

            <executions>
              <execution>
                <id>attach-javadocs</id>

                <configuration>
                  <tags>
                    <tag>
                      <name>apiNote</name>
                      <placement>a</placement>
                      <head>API Note:</head>
                    </tag>
                    <tag>
                      <name>implSpec</name>
                      <placement>a</placement>
                      <head>Implementation Requirements:</head>
                    </tag>
                    <tag>
                      <name>implNote</name>
                      <placement>a</placement>
                      <head>Implementation Note:</head>
                    </tag>
                  </tags>
                </configuration>

                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>release</id>

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>3.0.0-M3</version>

            <executions>
              <execution>
                <id>require-properties</id>

                <goals>
                  <goal>enforce</goal>
                </goals>

                <configuration>
                  <rules>
                    <requireProperty>
                      <property>project.name</property>
                      <message>Missing project.name.</message>
                    </requireProperty>
                    <requireProperty>
                      <property>project.description</property>
                      <message>Missing project.description.</message>
                    </requireProperty>
                    <requireProperty>
                      <property>project.url</property>
                      <message>Missing project.url.</message>
                    </requireProperty>
                    <requireProperty>
                      <property>project.licenses</property>
                      <message>Missing project.licenses.</message>
                    </requireProperty>
                    <requireProperty>
                      <property>project.developers</property>
                      <message>Missing project.developers.</message>
                    </requireProperty>
                    <requireProperty>
                      <property>project.scm</property>
                      <message>Missing project.scm.</message>
                    </requireProperty>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.7</version>

            <extensions>true</extensions>

            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
              <skipStagingRepositoryClose>true</skipStagingRepositoryClose>
              <autoReleaseAfterClose>false</autoReleaseAfterClose>
            </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>
        </plugins>
      </build>

      <distributionManagement>
        <repository>
          <id>ossrh</id>
          <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>

        <snapshotRepository>
          <id>ossrh</id>

          <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
      </distributionManagement>
    </profile>
  </profiles>

</project>
