<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>ch.usi.si.seart</groupId>
  <artifactId>jakarta-validation-utils-parent</artifactId>
  <version>0.3.0</version>
  <packaging>pom</packaging>

  <name>${project.groupId}:${project.artifactId}</name>
  <description>Utilities for the Jakarta Bean Validation API</description>
  <url>https://github.com/seart-group/jakarta-validation-utils</url>
  <inceptionYear>2023</inceptionYear>

  <modules>
    <module>jakarta-validation-utils</module>
    <module>jakarta-validation-utils-legacy</module>
  </modules>

  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://raw.githubusercontent.com/seart-group/jakarta-validation-utils/master/LICENSE</url>
    </license>
  </licenses>

  <organization>
    <name>SEART</name>
    <url>https://seart.si.usi.ch/</url>
  </organization>

  <developers>
    <developer>
      <id>dabico</id>
      <name>Ozren Dabić</name>
      <url>https://dabico.github.io/</url>
      <email>ozren.dabic@usi.ch</email>
      <organization>SEART</organization>
      <organizationUrl>https://seart.si.usi.ch/</organizationUrl>
    </developer>
  </developers>

  <scm>
    <tag>v0.3.0</tag>
    <url>https://github.com/seart-group/jakarta-validation-utils/tree/master</url>
    <connection>scm:git:https://github.com/seart-group/jakarta-validation-utils.git</connection>
    <developerConnection>scm:git:git@github.com:seart-group/jakarta-validation-utils.git</developerConnection>
  </scm>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/seart-group/jakarta-validation-utils/issues</url>
  </issueManagement>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <properties>
    <java.version>8</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <jakarta.validation.version>3.0.2</jakarta.validation.version>
    <jakarta.validation.basePackage>jakarta.validation</jakarta.validation.basePackage>
    <org.hibernate.validator.version>7.0.5.Final</org.hibernate.validator.version>
    <org.junit.version>5.10.1</org.junit.version>
    <org.projectlombok.version>1.18.30</org.projectlombok.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>${org.junit.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>jakarta.validation</groupId>
      <artifactId>jakarta.validation-api</artifactId>
      <version>${jakarta.validation.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>${org.projectlombok.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hibernate.validator</groupId>
      <artifactId>hibernate-validator</artifactId>
      <version>${org.hibernate.validator.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.3.1</version>
          <executions>
            <execution>
              <id>default-generate-sources</id>
              <phase>generate-sources</phase>
              <goals>
                <goal>copy-resources</goal>
              </goals>
              <configuration>
                <encoding>${project.build.sourceEncoding}</encoding>
                <outputDirectory>
                  ${project.build.sourceDirectory}/ch/usi/si/seart/validation
                </outputDirectory>
                <resources>
                  <resource>
                    <directory>
                      ${session.executionRootDirectory}/jakarta-validation-utils-template/validation
                    </directory>
                    <filtering>true</filtering>
                  </resource>
                </resources>
              </configuration>
            </execution>
            <execution>
              <id>default-generate-test-sources</id>
              <phase>generate-test-sources</phase>
              <goals>
                <goal>copy-resources</goal>
              </goals>
              <configuration>
                <encoding>${project.build.sourceEncoding}</encoding>
                <outputDirectory>
                  ${project.build.testSourceDirectory}/ch/usi/si/seart/validation/constraints
                </outputDirectory>
                <resources>
                  <resource>
                    <directory>
                      ${session.executionRootDirectory}/jakarta-validation-utils-template/test
                    </directory>
                    <filtering>true</filtering>
                  </resource>
                </resources>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>3.3.2</version>
      </plugin>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.4.1</version>
        <executions>
          <execution>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <version>${java.version}</version>
                </requireJavaVersion>
                <requireMavenVersion>
                  <version>3.0.0</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>3.3.1</version>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>9.3</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <configLocation>checkstyle.xml</configLocation>
              <includeTestSourceDirectory>false</includeTestSourceDirectory>
              <consoleOutput>true</consoleOutput>
              <failsOnError>true</failsOnError>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.11.0</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.3.0</version>
        <executions>
          <execution>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.6.3</version>
        <executions>
          <execution>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <show>public</show>
          <quiet>true</quiet>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.2.3</version>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.3.0</version>
      </plugin>
      <plugin>
        <artifactId>maven-install-plugin</artifactId>
        <version>3.1.1</version>
      </plugin>
      <plugin>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>3.1.1</version>
      </plugin>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <version>3.0.1</version>
        <configuration>
          <releaseProfiles>release</releaseProfiles>
          <preparationProfiles>release</preparationProfiles>
          <tagNameFormat>v@{project.version}</tagNameFormat>
          <preparationGoals>
            resources:copy-resources@default-generate-docs scm:add -Dincludes=README.md
          </preparationGoals>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.11</version>
        <executions>
          <execution>
            <id>default-prepare</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>default-report</id>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
          <execution>
            <id>default-check</id>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <rules>
                <rule>
                  <element>PACKAGE</element>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.8</minimum>
                    </limit>
                  </limits>
                </rule>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>4.3</version>
        <executions>
          <execution>
            <id>default-format-sources</id>
            <phase>process-sources</phase>
            <goals>
              <goal>format</goal>
            </goals>
            <configuration>
              <licenseSets>
                <licenseSet>
                  <header>${session.executionRootDirectory}/headers/HEADER</header>
                  <includes>
                    <include>src/main/**/*.java</include>
                  </includes>
                </licenseSet>
              </licenseSets>
            </configuration>
          </execution>
          <execution>
            <id>default-format-test-sources</id>
            <phase>process-test-sources</phase>
            <goals>
              <goal>format</goal>
            </goals>
            <configuration>
              <licenseSets>
                <licenseSet>
                  <header>${session.executionRootDirectory}/headers/WARNING</header>
                  <includes>
                    <include>src/test/**/*.java</include>
                  </includes>
                </licenseSet>
              </licenseSets>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <version>3.3.1</version>
            <executions>
              <execution>
                <id>default-generate-docs</id>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
                <configuration>
                  <encoding>${project.build.sourceEncoding}</encoding>
                  <outputDirectory>${project.basedir}</outputDirectory>
                  <resources>
                    <resource>
                      <directory>doc</directory>
                      <includes>
                        <include>README.md</include>
                      </includes>
                      <filtering>true</filtering>
                    </resource>
                  </resources>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
