<?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>com.github.kagkarlsson</groupId>
  <artifactId>db-scheduler-parent</artifactId>
  <version>16.9.0</version>
  <packaging>pom</packaging>

  <name>db-scheduler: Parent</name>
  <description>Simple persistent scheduler for scheduled tasks, recurring or ad-hoc.</description>
  <url>https://github.com/kagkarlsson/db-scheduler</url>
  <inceptionYear>2015</inceptionYear>

  <organization>
    <name>Gustav Karlsson</name>
    <url>https://github.com/kagkarlsson</url>
  </organization>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Gustav Karlsson</name>
      <email>kagkarlsson@gmail.com</email>
    </developer>
  </developers>

  <modules>
    <module>db-scheduler</module>
    <module>db-scheduler-spring-boot-starter-parent</module>
    <module>examples</module>
  </modules>

  <scm>
    <connection>scm:git:git@github.com:kagkarlsson/db-scheduler.git</connection>
    <developerConnection>scm:git:git@github.com:kagkarlsson/db-scheduler.git</developerConnection>
    <tag>HEAD</tag>
    <url>https://github.com/kagkarlsson/db-scheduler/</url>
  </scm>

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

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <jdk.version>17</jdk.version>
    <maven.compiler.source>${jdk.version}</maven.compiler.source>
    <maven.compiler.target>${jdk.version}</maven.compiler.target>
    <maven.compiler.release>${jdk.version}</maven.compiler.release>
    <compilerArgument/>
    <license.dir>${project.basedir}/.license</license.dir>

    <!-- Build-time flags -->
    <skipChecks>false</skipChecks>
    <failOnMissingHeader>true</failOnMissingHeader>
    <dependency-plugin.failOnWarning>true</dependency-plugin.failOnWarning>

    <!-- Dependency versions -->
    <slf4j.version>1.7.36</slf4j.version>
    <logback.version>1.2.13</logback.version>
    <spring-boot-3.version>3.5.14</spring-boot-3.version>
    <spring-boot-4.version>4.0.6</spring-boot-4.version>
    <micrometer.version>1.16.5</micrometer.version>
    <gson.version>2.13.2</gson.version>
    <jackson.version>2.21.3</jackson.version>
    <postgresql.version>42.7.11</postgresql.version>
    <guava.version>33.6.0-jre</guava.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>6.0.3</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-bom</artifactId>
        <version>5.20.0</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>testcontainers-bom</artifactId>
        <version>2.0.5</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.jspecify</groupId>
        <artifactId>jspecify</artifactId>
        <version>1.0.0</version>
      </dependency>
      <!-- Override to make testcontainers work on M1 -->
      <dependency>
        <groupId>net.java.dev.jna</groupId>
        <artifactId>jna</artifactId>
        <version>5.18.1</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.19.0</version>
        <scope>test</scope>
      </dependency>

    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.15.0</version>
          <configuration>
            <compilerArgument>${compilerArgument}</compilerArgument>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.5.5</version>
        </plugin>
        <plugin>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>3.10.0</version>
          <executions>
            <execution>
              <goals>
                <goal>analyze-only</goal>
              </goals>
              <configuration>
                <failOnWarning>${dependency-plugin.failOnWarning}</failOnWarning>
                <ignoreNonCompile>true</ignoreNonCompile>
                <ignoredDependencies>
                  <ignoredDependency>org.springframework.boot:spring-boot-autoconfigure-processor</ignoredDependency>
                  <ignoredDependency>org.springframework.boot:spring-boot-configuration-processor</ignoredDependency>
                </ignoredDependencies>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>5.0.0</version>
          <configuration>
            <licenseSets>
              <licenseSet>
                <header>${license.dir}/license-header.txt</header>
                <includes>
                  <include>**/*.java</include>
                </includes>
                <excludes>
                  <exclude>.github/**</exclude>
                  <exclude>**/src/test/**</exclude>
                  <exclude>**/RuntimeTypeAdapterFactory.java</exclude>
                </excludes>
              </licenseSet>
            </licenseSets>
            <failIfMissing>${failOnMissingHeader}</failIfMissing>
          </configuration>
          <executions>
            <execution>
              <id>check-license-header</id>
              <goals>
                <goal>check</goal>
              </goals>
              <phase>test</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>3.6.2</version>
          <configuration>
            <createSourcesJar>true</createSourcesJar>
            <shadeSourcesContent>true</shadeSourcesContent>
            <artifactSet>
              <includes>
                <include>com.cronutils:*</include>
              </includes>
            </artifactSet>
            <filters>
              <filter>
                <artifact>com.cronutils:*</artifact>
                <excludes>
                  <exclude>CronUtilsI18N*.properties</exclude>
                  <exclude>checkstyle.xml</exclude>
                  <exclude>META-INF/**</exclude>
                </excludes>
              </filter>
            </filters>
            <relocations>
              <relocation>
                <pattern>com.github.kagkarlsson.jdbc</pattern>
                <shadedPattern>com.github.kagkarlsson.shaded.jdbc</shadedPattern>
              </relocation>
              <relocation>
                <pattern>com.cronutils</pattern>
                <shadedPattern>com.github.kagkarlsson.shaded.cronutils</shadedPattern>
              </relocation>
            </relocations>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>shade</goal>
              </goals>
              <phase>package</phase>
            </execution>
          </executions>
        </plugin>

        <!-- Release plugins -->
        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.12.0</version>
          <configuration>
            <doclint>none</doclint>
          </configuration>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.4.0</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
              <configuration>
                <includePom>true</includePom>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.6.2</version>
          <executions>
            <execution>
              <id>enforce-maven</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <rules>
                  <requireMavenVersion>
                    <version>3.8.0</version>
                  </requireMavenVersion>
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>3.1.4</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>3.4.0</version>
        <configuration>
          <java>
            <includes>
              <include>src/main/java/**/*.java</include>
              <include>src/test/java/**/*.java</include>
            </includes>
            <googleJavaFormat>
              <version>1.28.0</version>
              <style>GOOGLE</style>
            </googleJavaFormat>
            <importOrder/>
            <removeUnusedImports/>
            <toggleOffOn/>
            <trimTrailingWhitespace/>
            <endWithNewline/>
          </java>
          <pom>
            <includes>
              <include>**/pom.xml</include>
            </includes>
            <sortPom/>
          </pom>
          <markdown>
            <includes>
              <include>**/*.md</include>
            </includes>
            <excludes>
              <exclude>.claude/**</exclude>
            </excludes>
            <flexmark/>
          </markdown>
        </configuration>
      </plugin>
    </plugins>

  </build>

  <profiles>
    <profile>
      <id>skipChecks</id>
      <activation>
        <property>
          <name>skipChecks</name>
          <value>true</value>
        </property>
      </activation>
      <properties>
        <skipChecks>true</skipChecks>
        <failOnMissingHeader>false</failOnMissingHeader>
        <dependency-plugin.failOnWarning>false</dependency-plugin.failOnWarning>
      </properties>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
          </plugin>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>publication</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
          </plugin>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>springBootDevelopment</id>
      <repositories>
        <repository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>spring-milestones</id>
          <name>Spring Milestones</name>
          <url>https://repo.spring.io/milestone</url>
        </repository>
        <repository>
          <releases>
            <enabled>false</enabled>
          </releases>
          <id>spring-snapshots</id>
          <name>Spring Snapshots</name>
          <url>https://repo.spring.io/snapshot</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>spring-milestones</id>
          <name>Spring Milestones</name>
          <url>https://repo.spring.io/milestone</url>
        </pluginRepository>
        <pluginRepository>
          <releases>
            <enabled>false</enabled>
          </releases>
          <id>spring-snapshots</id>
          <name>Spring Snapshots</name>
          <url>https://repo.spring.io/snapshot</url>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>

</project>
