<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.squashtest.tm.plugin</groupId>
  <artifactId>api.rest.reports</artifactId>
  <name>api-rest-reports</name>
  <version>13.0.0.RELEASE</version>
  <description>Generate a JSON file with the result of an SQL query execution of type SELECT pre-given in a
        configuration file located in plugins folder of a Squash instance</description>
  <url>http://www.squashtest.org</url>
  <inceptionYear>2021</inceptionYear>
  <developers>
    <developer>
      <id>qtran</id>
      <email>qtran{at}henix.fr</email>
    </developer>
  </developers>
  <licenses>
    <license>
      <name>GNU Lesser General Public License V3</name>
      <url>https://www.gnu.org/licenses/lgpl-3.0.txt</url>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:${project.basedir}</connection>
    <developerConnection>scm:git:${project.basedir}</developerConnection>
  </scm>
  <organization>
    <name>Henix, henix.fr</name>
    <url>http://www.henix.fr</url>
  </organization>
  <build>
    <sourceDirectory>src/main/java</sourceDirectory>
    <testSourceDirectory>src/test/java</testSourceDirectory>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <version>${maven-release-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>com.diffplug.spotless</groupId>
          <artifactId>spotless-maven-plugin</artifactId>
          <version>${spotless-maven-plugin.version}</version>
          <configuration>
            <java>
              <googleJavaFormat>
                <version>${google-java-format.version}</version>
              </googleJavaFormat>
              <indent>
                <tabs>true</tabs>
                <spacesPerTab>2</spacesPerTab>
              </indent>
              <indent>
                <spaces>true</spaces>
                <spacesPerTab>4</spacesPerTab>
              </indent>
              <removeUnusedImports />
            </java>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven-compiler-plugin.version}</version>
        <configuration>
          <parameters>true</parameters>
          <failOnWarning>true</failOnWarning>
          <compilerArgs>
            <arg>-proc:none</arg>
            <arg>-Xlint:deprecation</arg>
            <arg>-Xlint:all</arg>
          </compilerArgs>
          <release>${java.version}</release>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>${license-maven-plugin.version}</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <strictCheck>true</strictCheck>
          <properties>
            <project.label>JSON report for SELECT SQL query execution in Squash TM (${project.name})</project.label>
            <license.yearSpan>${project.inceptionYear}</license.yearSpan>
            <license.copyrightOwner>${project.organization.name}</license.copyrightOwner>
          </properties>
          <licenseSets>
            <licenseSet>
              <header>src/main/license/header.txt</header>
              <excludes>
                <exclude>**/NOTICE.*</exclude>
                <exclude>**/README.*</exclude>
                <exclude>**/NOTICE</exclude>
                <exclude>**/README</exclude>
                <exclude>**/README*.*</exclude>
                <exclude>**/readme*.*</exclude>
                <exclude>**/*.mf</exclude>
                <exclude>**/bnd.bnd</exclude>
                <exclude>**/build.properties</exclude>
                <exclude>**/pom.properties</exclude>
                <exclude>**/pom.xml</exclude>
                <exclude>.settings</exclude>
                <exclude>build.properties</exclude>
                <exclude>.classpath</exclude>
                <exclude>.project</exclude>
                <exclude>**/license/**</exclude>
                <exclude>**/*.iml</exclude>
                <exclude>.idea/**</exclude>
                <exclude>**/pom.xml.*</exclude>
                <exclude>META-INF/**</exclude>
                <exclude>**/assembly/layout/**</exclude>
                <exclude>**/*.adoc</exclude>
                <exclude>.m2/**</exclude>
                <exclude>**/.ci-friendly-pom.xml</exclude>
                <exclude>.editorconfig</exclude>
              </excludes>
            </licenseSet>
          </licenseSets>
          <mapping>
            <tag>DYNASCRIPT_STYLE</tag>
          </mapping>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>${maven-shade-plugin.version}</version>
        <executions>
          <execution>
            <id>shade-license</id>
            <phase>verify</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <transformers>
                <transformer />
              </transformers>
              <artifactSet>
                <includes>
                  <include>org.squashtest.tm.plugin</include>
                </includes>
              </artifactSet>
              <relocations>
                <relocation>
                  <pattern>org.squashtest.tm.plugin.licensevalidator</pattern>
                  <shadedPattern>org.squashtest.tm.plugin.api.rest.reports.licensevalidator</shadedPattern>
                </relocation>
              </relocations>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>${maven-assembly-plugin.version}</version>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/assembly.xml</descriptor>
              </descriptors>
              <appendAssemblyId>false</appendAssemblyId>
              <finalName>${project.artifactId}-${project.version}</finalName>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>${maven-resources-plugin.version}</version>
        <executions>
          <execution>
            <id>filter-documentation</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${asciidoc.filtered-directory}</outputDirectory>
              <resources>
                <resource>
                  <include>*.adoc</include>
                  <directory>src/main/asciidoc</directory>
                  <filtering>true</filtering>
                </resource>
                <resource>
                  <exclude>*.adoc</exclude>
                  <directory>src/main/asciidoc</directory>
                  <filtering>false</filtering>
                </resource>
              </resources>
            </configuration>
          </execution>
          <execution>
            <id>package-documentation</id>
            <phase>package</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${asciidoc.packaging.jar-path}</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.build.directory}/generated-docs</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.asciidoctor</groupId>
        <artifactId>asciidoctor-maven-plugin</artifactId>
        <version>${asciidoc-maven-plugin.version}</version>
        <executions>
          <execution>
            <id>generate-docs</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>process-asciidoc</goal>
            </goals>
            <configuration>
              <backend>html</backend>
              <doctype>book</doctype>
              <sourceDirectory>${asciidoc.filtered-directory}</sourceDirectory>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.springframework.restdocs</groupId>
            <artifactId>spring-restdocs-asciidoctor</artifactId>
            <version>${spring-asciidoc.version}</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${maven-jar-plugin.version}</version>
        <executions>
          <execution>
            <id>default-jar</id>
            <phase>none</phase>
          </execution>
          <execution>
            <id>integration-jar</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <forceCreation>true</forceCreation>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.outbrain.swinfra</groupId>
        <artifactId>ci-friendly-flatten-maven-plugin</artifactId>
        <version>${ci-friendly.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>clean</goal>
              <goal>flatten</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>integration-tests</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>add-integration-test-resource</id>
                <phase>generate-test-resources</phase>
                <goals>
                  <goal>add-test-resource</goal>
                </goals>
                <configuration>
                  <resources>
                    <resource>
                      <directory>src/test/resources</directory>
                    </resource>
                  </resources>
                </configuration>
              </execution>
              <execution>
                <id>regex-property</id>
                <goals>
                  <goal>regex-property</goal>
                </goals>
                <configuration>
                  <name>api.version</name>
                  <value>${project.version}</value>
                  <regex>^([0-9]+)\.([0-9]+)\.([0-9]+).*$</regex>
                  <replacement>$1.$2.$3</replacement>
                  <failIfNoMatch>true</failIfNoMatch>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <executions>
              <execution>
                <id>integration-tests</id>
                <phase>test</phase>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <repositories>
    <repository>
      <id>squash-release</id>
      <url>http://repo.squashtest.org/maven2/releases</url>
    </repository>
    <repository>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots />
      <id>squash-snapshot</id>
      <url>http://repo.squashtest.org/maven2/snapshots</url>
    </repository>
  </repositories>
  <dependencies>
    <dependency>
      <groupId>jakarta.ws.rs</groupId>
      <artifactId>jakarta.ws.rs-api</artifactId>
      <version>3.1.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.squashtest.tm</groupId>
      <artifactId>tm.service</artifactId>
      <version>13.0.0.RELEASE</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-hateoas</artifactId>
      <version>3.5.9</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <version>3.5.9</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>spring-boot-test</artifactId>
          <groupId>org.springframework.boot</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spring-boot-test-autoconfigure</artifactId>
          <groupId>org.springframework.boot</groupId>
        </exclusion>
        <exclusion>
          <artifactId>assertj-core</artifactId>
          <groupId>org.assertj</groupId>
        </exclusion>
        <exclusion>
          <artifactId>awaitility</artifactId>
          <groupId>org.awaitility</groupId>
        </exclusion>
        <exclusion>
          <artifactId>hamcrest</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-jupiter</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
        <exclusion>
          <artifactId>mockito-core</artifactId>
          <groupId>org.mockito</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jsonassert</artifactId>
          <groupId>org.skyscreamer</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spring-test</artifactId>
          <groupId>org.springframework</groupId>
        </exclusion>
        <exclusion>
          <artifactId>xmlunit-core</artifactId>
          <groupId>org.xmlunit</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>5.12.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>junit-platform-engine</artifactId>
          <groupId>org.junit.platform</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
      <version>5.17.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>mockito-core</artifactId>
          <groupId>org.mockito</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.springframework.restdocs</groupId>
      <artifactId>spring-restdocs-mockmvc</artifactId>
      <version>3.0.5</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>spring-restdocs-core</artifactId>
          <groupId>org.springframework.restdocs</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jakarta.servlet-api</artifactId>
          <groupId>jakarta.servlet</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spring-test</artifactId>
          <groupId>org.springframework</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.squashtest.tm</groupId>
        <artifactId>squash-tm-bom</artifactId>
        <version>${squash.core.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <distributionManagement>
    <repository>
      <id>squash-release-deploy-repo</id>
      <name>Squash releases deployment repo</name>
      <url>${deploy-repo.release.url}</url>
    </repository>
    <snapshotRepository>
      <id>squash-snapshot-deploy-repo</id>
      <name>Squash snapshot deployment repo</name>
      <url>${deploy-repo.snapshot.url}</url>
    </snapshotRepository>
  </distributionManagement>
  <properties>
    <sonar.projectName>${project.name}${env.APPEND_SONAR_PROJECT_NAME}</sonar.projectName>
    <license.validator.version>13.0.0.RELEASE</license.validator.version>
    <spring-asciidoc.version>3.0.5</spring-asciidoc.version>
    <maven-jar-plugin.version>3.5.0</maven-jar-plugin.version>
    <maven-shade-plugin.version>3.6.1</maven-shade-plugin.version>
    <maven-compiler-plugin.version>3.14.1</maven-compiler-plugin.version>
    <revision>13.0.0</revision>
    <spotless-maven-plugin.version>3.0.0</spotless-maven-plugin.version>
    <maven-surefire-plugin.version>3.5.4</maven-surefire-plugin.version>
    <changelist>-SNAPSHOT</changelist>
    <license-maven-plugin.version>5.0.0</license-maven-plugin.version>
    <maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
    <google-java-format.version>1.28.0</google-java-format.version>
    <maven-release-plugin.version>3.2.0</maven-release-plugin.version>
    <asciidoc.packaging.jar-path>${project.build.outputDirectory}/static/api/rest/latest/docs</asciidoc.packaging.jar-path>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <squash.core.version>13.0.0.RELEASE</squash.core.version>
    <ci-friendly.version>1.0.28</ci-friendly.version>
    <java.version>21</java.version>
    <asciidoc.filtered-directory>${project.build.directory}/filtered-asciidoc-sources</asciidoc.filtered-directory>
    <maven-assembly-plugin.version>3.7.1</maven-assembly-plugin.version>
    <sonar.projectKey>${project.groupId}:${project.artifactId}${env.APPEND_SONAR_PROJECT_KEY}</sonar.projectKey>
    <asciidoc-maven-plugin.version>3.2.0</asciidoc-maven-plugin.version>
  </properties>
</project>
