<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>

  <name>Sql Builder</name>
  <description>SQL Builder for Java</description>
  <groupId>org.tamilnadujug</groupId>
  <artifactId>sql-builder</artifactId>
  <version>1.0</version>
  <packaging>jar</packaging>

  <url>https://tamilnadujug.org</url>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Rajadurai Krishnamoorthy</name>
      <organization>OurKadai</organization>
      <email>rajadurai@ourkadai.com</email>
      <organizationUrl>http://www.ourkadai.com</organizationUrl>
    </developer>
    <developer>
      <name>Sathish Kumar Thiyagarajan</name>
      <organization>Ourkadai</organization>
      <organizationUrl>http://www.ourkadai.com</organizationUrl>
    </developer>
    <developer>
      <name>Ganesh Babu</name>
      <organization>Ourkadai</organization>
      <organizationUrl>http://www.Ourkadai.com</organizationUrl>
    </developer>
  </developers>
  <scm>
    <url>https://github.com/tamilnadujug/sql-builder</url>
  </scm>

  <properties>
    <java.version>17</java.version>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <maven.compiler.source>${java.version}</maven.compiler.source>

    <junit.version>5.13.4</junit.version>
    <archunit.version>1.4.1</archunit.version>
    <sonar.version>5.1.0.4751</sonar.version>
    <jacoco.version>0.8.13</jacoco.version>

    <maven-surefire-plugin.version>3.5.3</maven-surefire-plugin.version>
    <maven.checkstyle.version>3.6.0</maven.checkstyle.version>
    <checkstyle.version>10.26.1</checkstyle.version>

    <postgresql.version>42.7.7</postgresql.version>
    <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
    <maven-javadoc.version>3.3.1</maven-javadoc.version>
    <maven-gpg.version>3.0.1</maven-gpg.version>
    <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
  </properties>

  <!--distributionManagement>
    <repository>
      <id>github</id>
      <name>GitHub Packages</name>
      <url>https://maven.pkg.github.com/tamilnadujug/sql-builder</url>
    </repository>
  </distributionManagement-->

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>${junit.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>

    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <version>${postgresql.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.tngtech.archunit</groupId>
      <artifactId>archunit</artifactId>
      <version>${archunit.version}</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <plugins>

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${maven.checkstyle.version}</version>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>${checkstyle.version}</version>
          </dependency>
        </dependencies>
        <configuration>
          <suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
          <consoleOutput>true</consoleOutput>
          <failsOnError>true</failsOnError>
          <linkXRef>false</linkXRef>
        </configuration>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.sonarsource.scanner.maven</groupId>
        <artifactId>sonar-maven-plugin</artifactId>
        <version>${sonar.version}</version>
      </plugin>
      <!--JaCoCo Maven Plugin-->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${jacoco.version}</version>
        <configuration>
          <includes>
            <include>org/tamilnadujug/*</include>
          </includes>
        </configuration>
        <executions>
          <execution>
            <id>default-prepare-agent</id>
            <phase>test</phase>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
            <configuration>
              <!-- Sets the path to the file which contains the execution data. -->
              <destFile>target/coverage-reports/jacoco-ut.exec</destFile>
            </configuration>
          </execution>
          <execution>
            <id>default-report</id>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
          <execution>
            <id>default-check</id>
            <phase>test</phase>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <rules>
                <rule>
                  <element>PACKAGE</element>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.99</minimum>
                    </limit>
                  </limits>
                </rule>
              </rules>
            </configuration>
          </execution>
          <execution>
            <id>post-integration-test</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>report</goal>
            </goals>
            <configuration>
              <dataFile>target/coverage-reports/jacoco-it.exec</dataFile>
              <outputDirectory>target/coverage-reports/jacoco-it</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
        <version>0.8.0</version>
        <extensions>true</extensions>
        <configuration>
          <publishingServerId>central</publishingServerId>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${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>${maven-javadoc.version}</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- Sign artifacts for uploading to maven central -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>${maven-gpg.version}</version>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>package</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
