<?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.admin</artifactId>
  <name>api-rest-admin</name>
  <version>10.2.0.RELEASE</version>
  <description>A plugin that exposes a REST API for Squash TM, dedicated to administration tasks, version 1.20+</description>
  <url>http://www.henix.com/</url>
  <inceptionYear>2019</inceptionYear>
  <developers>
    <developer>
      <id>akader</id>
      <email>akader{at}henix.fr</email>
    </developer>
  </developers>
  <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/groovy</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>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>${build-helper-maven-plugin.version}</version>
        <executions>
          <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-remote-resources-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>bundle</goal>
              <goal>process</goal>
            </goals>
            <configuration>
              <resourceBundles>
                <resourceBundle>${project.groupId}:${project.artifactId}:${project.version}</resourceBundle>
              </resourceBundles>
            </configuration>
          </execution>
        </executions>
      </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>
        <inherited>false</inherited>
        <configuration>
          <strictCheck>true</strictCheck>
          <aggregate>true</aggregate>
          <properties>
            <project.label>ADMIN REST API plugin for Squash TM (${project.name})</project.label>
            <license.yearSpan>${project.inceptionYear}</license.yearSpan>
            <license.copyrightOwner>${project.organization.name}</license.copyrightOwner>
          </properties>
          <licenseSets>
            <licenseSet>
              <header>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>**/*.orig</exclude>
                <exclude>**/.hgtags</exclude>
                <exclude>**/.hgignore</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-compiler-plugin</artifactId>
        <version>${maven-compiler-plugin.version}</version>
        <dependencies>
          <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-batch</artifactId>
            <version>${groovy-eclipse-batch.version}</version>
          </dependency>
          <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-compiler</artifactId>
            <version>${groovy-eclipse-compiler.version}</version>
          </dependency>
        </dependencies>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
          <compilerId>groovy-eclipse-compiler</compilerId>
          <parameters>true</parameters>
          <excludes>
            <exclude>src/it/groovy/**</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-failsafe-surefire-plugin.version}</version>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <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>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.asciidoctor</groupId>
        <artifactId>asciidoctor-maven-plugin</artifactId>
        <version>${asciidoc.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>
              <attributes>
                <snippets>${project.build.directory}/generated-snippets</snippets>
              </attributes>
            </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-resources-plugin</artifactId>
        <version>${maven-resources-plugin.version}</version>
        <executions>
          <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>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${maven-jar-plugin.version}</version>
        <executions>
          <execution>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <forceCreation>true</forceCreation>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>${maven-shade-plugin.version}</version>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
        <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.rest.admin.licensevalidator</shadedPattern>
            </relocation>
          </relocations>
        </configuration>
      </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>assembly/assembly.xml</descriptor>
              </descriptors>
              <appendAssemblyId>false</appendAssemblyId>
              <finalName>${project.artifactId}-${project.version}</finalName>
            </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>disable-java8-doclint</id>
      <properties>
        <additionalparam>-Xdoclint:none</additionalparam>
      </properties>
    </profile>
    <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-source</id>
                <phase>generate-test-sources</phase>
                <goals>
                  <goal>add-test-source</goal>
                </goals>
                <configuration>
                  <sources>
                    <source>src/it/groovy</source>
                  </sources>
                </configuration>
              </execution>
              <execution>
                <id>add-integration-test-resource</id>
                <phase>generate-test-resources</phase>
                <goals>
                  <goal>add-test-resource</goal>
                </goals>
                <configuration>
                  <resources>
                    <resource>
                      <directory>src/it/resources</directory>
                    </resource>
                  </resources>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>${maven-failsafe-surefire-plugin.version}</version>
            <executions>
              <execution>
                <id>integration-tests</id>
                <phase>test</phase>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <properties>
        <it.enabled>true</it.enabled>
      </properties>
    </profile>
    <profile>
      <id>distro</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>${maven-enforcer-plugin.version}</version>
            <executions>
              <execution>
                <id>enforce-profile-integration-tests</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireProperty>
                      <property>it.enabled</property>
                      <message>You forgot to enable the profile integration-tests.
												That profile runs all the tests and generates the
												documentation.</message>
                      <regex>true</regex>
                    </requireProperty>
                  </rules>
                  <fail>true</fail>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <repositories>
    <repository>
      <id>squash-release-repo</id>
      <url>http://repo.squashtest.org/maven2/releases</url>
    </repository>
    <repository>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots />
      <id>squash-snapshot-repo</id>
      <url>http://repo.squashtest.org/maven2/snapshots</url>
    </repository>
  </repositories>
  <dependencies>
    <dependency>
      <groupId>org.squashtest.tm.plugin</groupId>
      <artifactId>api.rest.core</artifactId>
      <version>10.2.0.RELEASE</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.squashtest.tm.plugin</groupId>
      <artifactId>api.rest.services</artifactId>
      <version>10.2.0.RELEASE</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.squashtest.tm.plugin</groupId>
      <artifactId>domainbuilder</artifactId>
      <version>10.2.0.RELEASE</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-hateoas</artifactId>
      <version>3.3.9</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.squashtest.tm</groupId>
      <artifactId>tm.domain</artifactId>
      <version>10.0.0.RELEASE</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.squashtest.tm</groupId>
      <artifactId>tm.service</artifactId>
      <version>10.0.0.RELEASE</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.squashtest.tm</groupId>
      <artifactId>tm.web</artifactId>
      <version>10.0.0.RELEASE</version>
      <classifier>classes</classifier>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.squashtest.tm</groupId>
      <artifactId>spock-test-dependencies</artifactId>
      <version>10.0.0.RELEASE</version>
      <type>pom</type>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>cglib-nodep</artifactId>
          <groupId>cglib</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spock-core</artifactId>
          <groupId>org.spockframework</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spock-spring</artifactId>
          <groupId>org.spockframework</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spock-unitils</artifactId>
          <groupId>org.spockframework</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spring-boot-starter-test</artifactId>
          <groupId>org.springframework.boot</groupId>
        </exclusion>
        <exclusion>
          <artifactId>unitils-core</artifactId>
          <groupId>org.unitils</groupId>
        </exclusion>
        <exclusion>
          <artifactId>unitils-database</artifactId>
          <groupId>org.unitils</groupId>
        </exclusion>
        <exclusion>
          <artifactId>unitils-dbunit</artifactId>
          <groupId>org.unitils</groupId>
        </exclusion>
        <exclusion>
          <artifactId>unitils-spring</artifactId>
          <groupId>org.unitils</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.springframework.restdocs</groupId>
      <artifactId>spring-restdocs-mockmvc</artifactId>
      <version>3.0.3</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>spring-restdocs-core</artifactId>
          <groupId>org.springframework.restdocs</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spring-test</artifactId>
          <groupId>org.springframework</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.modelmapper</groupId>
      <artifactId>modelmapper</artifactId>
      <version>3.2.1</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.spockframework</groupId>
      <artifactId>spock-junit4</artifactId>
      <version>2.3-groovy-4.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>spock-core</artifactId>
          <groupId>org.spockframework</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>
    <spock-junit.version>2.3-groovy-4.0</spock-junit.version>
    <license.validator.version>10.0.0.RELEASE</license.validator.version>
    <api.rest.version>10.2.0.RELEASE</api.rest.version>
    <additionalparam>-Xdoclint:none</additionalparam>
    <spring-asciidoc.version>3.0.3</spring-asciidoc.version>
    <maven-jar-plugin.version>2.4</maven-jar-plugin.version>
    <maven-shade-plugin.version>3.6.0</maven-shade-plugin.version>
    <maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
    <revision>10.2.0</revision>
    <spotless-maven-plugin.version>2.43.0</spotless-maven-plugin.version>
    <groovy-eclipse-compiler.version>3.9.0</groovy-eclipse-compiler.version>
    <maven-enforcer-plugin.version>3.5.0</maven-enforcer-plugin.version>
    <changelist>-SNAPSHOT</changelist>
    <license-maven-plugin.version>4.6</license-maven-plugin.version>
    <maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
    <google-java-format.version>1.21.0</google-java-format.version>
    <maven-release-plugin.version>3.1.1</maven-release-plugin.version>
    <groovy-eclipse-batch.version>4.0.24-03</groovy-eclipse-batch.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>10.0.0.RELEASE</squash.core.version>
    <ci-friendly.version>1.0.27</ci-friendly.version>
    <java.version>21</java.version>
    <modelmapper.version>3.2.1</modelmapper.version>
    <asciidoc.filtered-directory>${project.build.directory}/filtered-asciidoc-sources</asciidoc.filtered-directory>
    <build-helper-maven-plugin.version>3.6.0</build-helper-maven-plugin.version>
    <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.version>3.1.1</asciidoc.version>
    <maven-failsafe-surefire-plugin.version>3.5.2</maven-failsafe-surefire-plugin.version>
  </properties>
</project>
