<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://maven.apache.org/POM/4.0.0"
  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>

  <artifactId>compilit-commons</artifactId>
  <packaging>pom</packaging>

  <parent>
    <groupId>com.compilit</groupId>
    <artifactId>compilit-parent-pom</artifactId>
    <version>${revision}</version>
    <relativePath>compilit-parent-pom/pom.xml</relativePath>
  </parent>

  <name>Compilit - commons pom</name>
  <description>The library consists of several useful implementations of often needed techniques and technologies
  </description>

  <properties>
    <jacoco.version>0.8.8</jacoco.version>
    <maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
    <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
    <maven-javadoc-plugin.version>3.3.1</maven-javadoc-plugin.version>
    <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
    <maven-scm-provider-gitexe.version>1.9.5</maven-scm-provider-gitexe.version>
    <maven-sonar-plugin.version>3.9.1.2184</maven-sonar-plugin.version>
    <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
    <maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
    <nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
    <flatten-maven-plugin.version>1.3.0</flatten-maven-plugin.version>
  </properties>

  <url>https://github.com/compilit/compilit-commons</url>

  <modules>
    <module>results</module>
    <module>domain-primitives</module>
    <module>value-guards</module>
    <module>value-sanitization-core</module>
    <module>fuzzy-matching</module>
    <module>cryptography-api</module>
    <module>cryptography-core</module>
    <module>cryptography-spring</module>
    <module>cqers-mediator-api</module>
    <module>cqers-mediator-core</module>
    <module>cqers-mediator-spring</module>
    <module>validation-api</module>
    <module>validation-core</module>
    <module>logging-api</module>
    <module>logging-spring</module>
    <module>value-sanitization-api</module>
    <module>value-sanitization-spring</module>
    <module>compilit-parent-pom</module>
  </modules>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <reuseForks>false</reuseForks>
        </configuration>
        <!-- 2.22.0+ Needed for Junit 5 Maven integration -->
        <groupId>org.apache.maven.plugins</groupId>
        <version>${maven-surefire-plugin.version}</version>
      </plugin>
      <plugin>
        <artifactId>maven-deploy-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>deploy</goal>
            </goals>
            <id>default-deploy</id>
            <phase>deploy</phase>
          </execution>
        </executions>
        <groupId>org.apache.maven.plugins</groupId>
        <version>${maven-deploy-plugin.version}</version>
      </plugin>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
          <localCheckout>true</localCheckout>
          <mavenExecutorId>forked-path</mavenExecutorId>
          <pushChanges>false</pushChanges>
        </configuration>
        <dependencies>
          <dependency>
            <artifactId>maven-scm-provider-gitexe</artifactId>
            <groupId>org.apache.maven.scm</groupId>
            <version>${maven-scm-provider-gitexe.version}</version>
          </dependency>
        </dependencies>
        <groupId>org.apache.maven.plugins</groupId>
        <version>${maven-release-plugin.version}</version>
      </plugin>
      <plugin>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <configuration>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
          <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
          <serverId>ossrh</serverId>
        </configuration>
        <extensions>true</extensions>
        <groupId>org.sonatype.plugins</groupId>
        <version>${nexus-staging-maven-plugin.version}</version>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>jar</goal>
            </goals>
            <id>attach-sources</id>
          </execution>
          <execution>
            <goals>
              <goal>jar</goal>
            </goals>
            <id>attach-javadoc</id>
          </execution>
        </executions>
        <groupId>org.apache.maven.plugins</groupId>
        <version>${maven-source-plugin.version}</version>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <encoding>UTF-8</encoding>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>jar</goal>
            </goals>
            <id>attach-javadoc</id>
          </execution>
        </executions>
        <groupId>org.apache.maven.plugins</groupId>
        <version>${maven-javadoc-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>flatten-maven-plugin</artifactId>
        <version>${flatten-maven-plugin.version}</version>
        <configuration>
          <pomElements>
            <name>keep</name>
          </pomElements>
        </configuration>
        <executions>
          <execution>
            <id>flatten</id>
            <phase>process-resources</phase>
            <goals>
              <goal>flatten</goal>
            </goals>
          </execution>
          <execution>
            <id>flatten.clean</id>
            <phase>clean</phase>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <build>
        <plugins>
          <plugin>
            <artifactId>sonar-maven-plugin</artifactId>
            <groupId>org.sonarsource.scanner.maven</groupId>
            <version>${maven-sonar-plugin.version}</version>
          </plugin>
          <plugin>
            <artifactId>jacoco-maven-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
                <id>prepare-agent</id>
              </execution>
              <execution>
                <goals>
                  <goal>report</goal>
                </goals>
                <id>report</id>
                <phase>test</phase>
              </execution>
            </executions>
            <groupId>org.jacoco</groupId>
            <version>${jacoco.version}</version>
          </plugin>
        </plugins>
      </build>
      <id>report-code-quality</id>
    </profile>
    <profile>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <configuration>
                  <keyname>${gpg.keyname}</keyname>
                  <passphraseServerId>${gpg.keyname}</passphraseServerId>
                </configuration>
                <goals>
                  <goal>sign</goal>
                </goals>
                <id>sign-artifacts</id>
                <phase>verify</phase>
              </execution>
            </executions>
            <groupId>org.apache.maven.plugins</groupId>
            <version>${maven-gpg-plugin.version}</version>
          </plugin>
        </plugins>
      </build>
      <id>release-sign-artifacts</id>
    </profile>
  </profiles>

</project>
