<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>dev.nextgin.commons</groupId>
  <artifactId>datetimeperiod</artifactId>
  <version>1.1.2</version>
  <packaging>jar</packaging>

  <name>datetimeperiod</name>
  <description>Complex date time period comparisons</description>
  <url>https://github.com/nextgin/commons-datetimeperiod</url>

  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://opensource.org/license/mit</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Othmane OUTAMA</name>
      <email>contact@nextgin.dev</email>
      <url>https://ooutama.com</url>
      <organization>Nextgin</organization>
      <organizationUrl>https://www.nextgin.dev</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/nextgin/commons-datetimeperiod.git</connection>
    <developerConnection>scm:git:ssh://github.com:nextgin/commons-datetimeperiod.git</developerConnection>
    <url>https://github.com/nextgin/commons-datetimeperiod/tree/main</url>
  </scm>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <jupiter.version>5.11.1</jupiter.version>
    <spotless.version>2.43.0</spotless.version>
    <jakarta-annotation.version>3.0.0</jakarta-annotation.version>
    <assertj.version>3.26.3</assertj.version>
    <sonatype-central-publishing-maven-plugin.version>0.6.0</sonatype-central-publishing-maven-plugin.version>
    <sonatype-nexus-staging-plugin.version>1.7.0</sonatype-nexus-staging-plugin.version>
    <apache-maven-source-plugin.version>3.3.1</apache-maven-source-plugin.version>
    <apache-maven-javadoc-plugin.version>3.10.1</apache-maven-javadoc-plugin.version>
    <apache-maven-gpg-plugin.version>3.2.7</apache-maven-gpg-plugin.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>jakarta.annotation</groupId>
      <artifactId>jakarta.annotation-api</artifactId>
      <version>${jakarta-annotation.version}</version>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>${jupiter.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>${assertj.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>${spotless.version}</version>
        <configuration>
          <java>
            <includes>
              <include>src/main/java/**/*.java</include>
              <include>src/test/java/**/*.java</include>
            </includes>
            <palantirJavaFormat/>
            <importOrder/>
            <removeUnusedImports/>
            <formatAnnotations/>
          </java>
          <pom>
            <includes>
              <include>**/pom.xml</include>
            </includes>
            <sortPom>
              <expandEmptyElements>false</expandEmptyElements>
            </sortPom>
          </pom>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>compile</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>${sonatype-central-publishing-maven-plugin.version}</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
              <autoPublish>true</autoPublish>
              <waitUntil>uploaded</waitUntil>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>${apache-maven-source-plugin.version}</version>
            <executions>
              <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>${apache-maven-javadoc-plugin.version}</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${apache-maven-gpg-plugin.version}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <goals>
                  <goal>sign</goal>
                </goals>
                <phase>verify</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
