<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>de.focus-shift</groupId>
  <artifactId>jollyday</artifactId>
  <version>1.5.0</version>
  <packaging>pom</packaging>

  <name>Jollyday</name>
  <description>
    This API determines the holidays for a given year, country/name and eventually state/region. The holiday data is
    stored in XML files (one for each country) and will be read from the classpath. You can provide your own holiday
    calendar XML file or use any of the provided ones.

    Currently, there are over 80 countries supported like the following:
    * United States
    * Germany
    * France
    * India
    * Australia
    * and so on

    Besides, those there will be more special calendars like currently existing NYSE calendar (New York Stock Exchange).
  </description>
  <url>https://github.com/focus-shift/jollyday</url>

  <licenses>
    <license>
      <name>Apache License 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>11</java.version>

    <tests.groups>!BenchmarkTest</tests.groups>

    <junit.version>5.11.4</junit.version>
    <mockito.version>5.15.2</mockito.version>
    <assertj.version>3.27.3</assertj.version>
    <jqwik.version>1.9.2</jqwik.version>
    <jmh.version>1.37</jmh.version>

    <!--suppress UnresolvedMavenProperty - for IDEA-->
    <sonar.coverage.jacoco.xmlReportPaths>
      ${maven.multiModuleProjectDirectory}/jollyday-tests/target/site/jacoco-aggregate/jacoco.xml
    </sonar.coverage.jacoco.xmlReportPaths>
    <sonar.java.source>
      ${java.version}
    </sonar.java.source>
  </properties>

  <modules>
    <module>jollyday-core</module>
    <module>jollyday-jackson</module>
    <module>jollyday-jaxb</module>
  </modules>

  <developers>
    <developer>
      <id>schneider</id>
      <email>Tobias.Schneider@focus-shift.de</email>
      <name>Tobias Schneider</name>
    </developer>
  </developers>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/focus-shift/jollyday/issues</url>
  </issueManagement>

  <scm>
    <connection>scm:git:git://github.com/focus-shift/jollyday.git</connection>
    <developerConnection>scm:git:git@github.com:focus-shift/jollyday.git</developerConnection>
    <url>https://github.com/focus-shift/jollyday.git</url>
    <tag>HEAD</tag>
  </scm>

  <dependencyManagement>
    <dependencies>

      <dependency>
        <groupId>org.threeten</groupId>
        <artifactId>threeten-extra</artifactId>
        <version>1.8.0</version>
      </dependency>

      <!-- Tests -->
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.xmlunit</groupId>
        <artifactId>xmlunit-core</artifactId>
        <version>2.10.0</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>${assertj.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${mockito.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-junit-jupiter</artifactId>
        <version>${mockito.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>net.jqwik</groupId>
        <artifactId>jqwik</artifactId>
        <version>${jqwik.version}</version>
        <scope>test</scope>
      </dependency>

      <!-- jollyday uses slf4j as the logging API / facade so users can use logback or other slf4j compliant frameworks -->
      <!-- if there is no slf4j implementation (binding) provided at runtime, slf4j will fall back to a no-op provider -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>2.0.16</version>
      </dependency>

      <!-- provide a slf4j binding to have logs for jollyday tests -->
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.5.16</version>
        <scope>test</scope>
      </dependency>

      <!-- jmh -->
      <dependency>
        <groupId>org.openjdk.jmh</groupId>
        <artifactId>jmh-core</artifactId>
        <version>${jmh.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.openjdk.jmh</groupId>
        <artifactId>jmh-generator-annprocess</artifactId>
        <version>${jmh.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <version>5.1.9</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.5.2</version>
          <configuration>
            <groups>${tests.groups}</groups>
          </configuration>
        </plugin>

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

        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>0.8.12</version>
        </plugin>

        <plugin>
          <groupId>org.sonarsource.scanner.maven</groupId>
          <artifactId>sonar-maven-plugin</artifactId>
          <version>5.0.0.4389</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.3.1</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>3.11.2</version>
        <configuration>
          <quiet>true</quiet>
          <excludePackageNames>de.focus_shift.jollyday.jaxb.mapping:de.focus_shift.jollyday.jackson.mapping</excludePackageNames>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.5.0</version>
        <dependencies>
          <dependency>
            <groupId>de.skuzzle.enforcer</groupId>
            <artifactId>restrict-imports-enforcer-rule</artifactId>
            <version>2.6.0</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>enforce-versions</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>3.8.5</version>
                </requireMavenVersion>
                <requireJavaVersion>
                  <version>${java.version}</version>
                </requireJavaVersion>
                <RestrictImports>
                  <reason>Use SLF4j for logging</reason>
                  <bannedImport>java.util.logging.**</bannedImport>
                </RestrictImports>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.13.0</version>
        <configuration>
          <release>${java.version}</release>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>coverage</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.12</version>
            <executions>
              <execution>
                <id>prepare-agent</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>release</id>
      <distributionManagement>
        <snapshotRepository>
          <id>ossrh</id>
          <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
      </distributionManagement>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.7</version>
            <configuration>
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.7.0</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>no-release</id>
      <!--
      According to https://github.com/sonatype/nexus-maven-plugins/tree/master/staging/maven-plugin
      skipNexusStagingDeployMojo may not be set to true in the last reactor module. Because we don't
      want to deploy our last module, nor a dummy module, we simply omit the relevant modules when
      a deployment is in progress.
      -->
      <activation>
        <property>
          <name>!release</name>
        </property>
      </activation>
      <modules>
        <module>jollyday-tests</module>
      </modules>
    </profile>

  </profiles>
</project>
