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

  <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>4.0.6</version>
  </parent>

  <groupId>it.fabioformosa.quartz-manager</groupId>
  <artifactId>quartz-manager-parent</artifactId>
  <version>4.1.2-SNAPSHOT</version>

  <packaging>pom</packaging>

  <name>Quartz Manager</name>
  <description>API and UI Manager for Quartz Scheduler</description>

  <url>https://github.com/fabioformosa/quartz-manager</url>

  <licenses>
    <license>
      <name>Apache License 2.0</name>
      <url>https://github.com/fabioformosa/quartz-manager/blob/master/LICENSE</url>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git://github.com/fabioformosa/quartz-manager.git</connection>
    <developerConnection>scm:git:git@github.com:fabioformosa/quartz-manager.git</developerConnection>
    <url>https://github.com/fabioformosa/quartz-manager</url>
    <tag>HEAD</tag>
  </scm>

  <developers>
    <developer>
      <name>Fabio Formosa</name>
      <url>https://github.com/fabioformosa</url>
    </developer>
  </developers>

  <properties>
    <java.version>21</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <org.projectlombok.version>1.18.42</org.projectlombok.version>
    <maven-surefire-plugin.version>3.5.4</maven-surefire-plugin.version>
    <maven-failsafe-plugin.version>3.5.4</maven-failsafe-plugin.version>
    <jacoco-maven-plugin.version>0.8.14</jacoco-maven-plugin.version>
    <maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>
    <nexus-staging-maven-plugin.version>1.6.7</nexus-staging-maven-plugin.version>
    <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
    <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
    <sonar-maven-plugin.version>5.2.0.4988</sonar-maven-plugin.version>
    <sonar.organization>fabioformosa</sonar.organization>
    <sonar.host.url>https://sonarcloud.io</sonar.host.url>
    <sonar.exclusions>
      **/SpringApplicationTest.java, **/QuartManagerApplicationTests.java, **/MisfireTestJob.java
    </sonar.exclusions>
    <sonar.coverage.exclusions>
      OpenApiConfig.java,
      **/SecurityOpenApiConfig.java, **/QuartzModuleProperties.java, **/QuartzManagerDemoApplication.java,
      **/ServletInitializer.java, **/SessionController.java, **/HealthCheckController.java,
      **/WebShowcaseOpenApiConfig.java, **/MisfireTestJob.java, **/PersistenceConfig.java,
      **/QuartzManagerSecurityConfig.java
    </sonar.coverage.exclusions>
  </properties>

  <modules>
    <module>quartz-manager-starter-api</module>
    <module>quartz-manager-starter-ui</module>
    <module>quartz-manager-starter-security</module>
    <module>quartz-manager-web-showcase</module>
    <module>quartz-manager-starter-persistence</module>
    <module>quartz-manager-common</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>it.fabioformosa.quartz-manager</groupId>
        <artifactId>quartz-manager-common</artifactId>
        <version>4.1.2-SNAPSHOT</version>
      </dependency>
      <dependency>
        <groupId>it.fabioformosa.quartz-manager</groupId>
        <artifactId>quartz-manager-starter-api</artifactId>
        <version>4.1.2-SNAPSHOT</version>
      </dependency>
      <dependency>
        <groupId>it.fabioformosa.quartz-manager</groupId>
        <artifactId>quartz-manager-starter-security</artifactId>
        <version>4.1.2-SNAPSHOT</version>
      </dependency>
      <dependency>
        <groupId>it.fabioformosa.quartz-manager</groupId>
        <artifactId>quartz-manager-starter-persistence</artifactId>
        <version>4.1.2-SNAPSHOT</version>
      </dependency>
      <dependency>
        <groupId>it.fabioformosa.quartz-manager</groupId>
        <artifactId>quartz-manager-starter-ui</artifactId>
        <version>4.1.2-SNAPSHOT</version>
      </dependency>
      <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>${org.projectlombok.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter</artifactId>
        <scope>test</scope>
      </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <release>${java.version}</release>
          <encoding>${project.build.sourceEncoding}</encoding>
          <annotationProcessorPaths>
            <path>
              <groupId>org.projectlombok</groupId>
              <artifactId>lombok</artifactId>
              <version>${org.projectlombok.version}</version>
            </path>
          </annotationProcessorPaths>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>${maven-failsafe-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.sonarsource.scanner.maven</groupId>
        <artifactId>sonar-maven-plugin</artifactId>
        <version>${sonar-maven-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${jacoco-maven-plugin.version}</version>
        <configuration>
          <excludes>
            <exclude>**/OpenApiConfig.class</exclude>
            <exclude>**/SecurityOpenApiConfig.class</exclude>
            <exclude>**/QuartzModuleProperties.class</exclude>
            <exclude>**/QuartzManagerDemoApplication.class</exclude>
            <exclude>**/ServletInitializer.class</exclude>
            <exclude>**/SessionController.class</exclude>
            <exclude>**/HealthCheckController.class</exclude>
            <exclude>**/WebShowcaseOpenApiConfig.class</exclude>
            <exclude>**/MisfireTestJob.class</exclude>
          </excludes>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>generate-code-coverage-report</id>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
          <execution>
            <id>report-aggregate</id>
            <goals>
              <goal>report-aggregate</goal>
            </goals>
            <phase>verify</phase>
          </execution>
        </executions>
      </plugin>

      <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</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>${maven-release-plugin.version}</version>
        <configuration>
          <preparationGoals>clean</preparationGoals>
          <tagNameFormat>v@{project.version}</tagNameFormat>
          <releaseProfiles>build-webjar</releaseProfiles>
          <localCheckout>true</localCheckout>
          <pushChanges>false</pushChanges>
          <mavenExecutorId>forked-path</mavenExecutorId>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.scm</groupId>
            <artifactId>maven-scm-provider-gitexe</artifactId>
            <version>1.9.5</version>
          </dependency>
        </dependencies>
      </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>
              <detectJavaApiLink>false</detectJavaApiLink>
              <doclint>none</doclint>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!-- GPG Signature on release -->
    <profile>
      <id>release-maven-central</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <distributionManagement>
        <snapshotRepository>
          <id>maven-central-release</id>
          <url>https://central.sonatype.com/repository/maven-snapshots/</url>
        </snapshotRepository>
        <repository>
          <id>maven-central-release</id>
          <url>https://central.sonatype.com</url>
        </repository>
      </distributionManagement>
      <build>
        <plugins>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>0.10.0</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>maven-central-release</publishingServerId>
              <autoPublish>true</autoPublish>
              <waitUntil>published</waitUntil>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven-gpg-plugin.version}</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>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>deploy-github</id>
      <distributionManagement>
        <repository>
          <id>github</id>
          <name>GitHub Packages</name>
          <url>https://maven.pkg.github.com/fabioformosa/quartz-manager</url>
        </repository>
      </distributionManagement>
    </profile>
  </profiles>

</project>
