<?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>bugtracker.gitlab</artifactId>
  <name>bugtracker-gitlab</name>
  <version>13.0.2.RC2</version>
  <url>http://www.squashtest.org</url>
  <inceptionYear>2021</inceptionYear>
  <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>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <version>${maven-release-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven-surefire-plugin.version}</version>
        </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-shade-plugin</artifactId>
        <version>${maven-shade-plugin.version}</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <transformers>
            <transformer />
          </transformers>
          <artifactSet>
            <includes>
              <include>org.squashtest.tm.plugin</include>
              <include>org.gitlab4j:*</include>
              <include>com.fasterxml.jackson.*:*</include>
              <include>org.glassfish.*:*</include>
              <include>org.apache.httpcomponents:*</include>
              <include>org.jvnet.mimepull:*</include>
              <include>jakarta.ws.rs:*</include>
            </includes>
          </artifactSet>
          <relocations>
            <relocation>
              <pattern>org.gitlab4j</pattern>
              <shadedPattern>gitlabbt.org.gitlab4j</shadedPattern>
            </relocation>
            <relocation>
              <pattern>com.fasterxml.jackson</pattern>
              <shadedPattern>gitlabbt.com.fasterxml.jackson</shadedPattern>
            </relocation>
            <relocation>
              <pattern>org.glassfish</pattern>
              <shadedPattern>gitlabbt.org.glassfish</shadedPattern>
            </relocation>
            <relocation>
              <pattern>org.apache.httpcomponents</pattern>
              <shadedPattern>gitlabbt.org.apache.httpcomponents</shadedPattern>
            </relocation>
            <relocation>
              <pattern>org.jvnet</pattern>
              <shadedPattern>gitlabbt.org.jvnet</shadedPattern>
            </relocation>
            <relocation>
              <pattern>org.aopalliance</pattern>
              <shadedPattern>gitlabbt.org.aopalliance</shadedPattern>
            </relocation>
            <relocation>
              <pattern>javax.ws.rs</pattern>
              <shadedPattern>gitlabbt.jakarta.ws.rs</shadedPattern>
            </relocation>
          </relocations>
        </configuration>
      </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>GitLab bugtracker connector for 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>**/*.orig</exclude>
                <exclude>**/.hgtags</exclude>
                <exclude>**/.hgignore</exclude>
                <exclude>**/build.properties</exclude>
                <exclude>**/pom.properties</exclude>
                <exclude>**/assembly/layout/</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>**/nbactions.xml</exclude>
                <exclude>**/nb-configuration.xml</exclude>
                <exclude>**/pom.xml.*</exclude>
                <exclude>META-INF/**</exclude>
                <exclude>Jenkinsfile</exclude>
                <exclude>node_modules/**</exclude>
                <exclude>node/**</exclude>
                <exclude>dist/**</exclude>
                <exclude>src/main/front-end/**</exclude>
                <exclude>.yarnrc</exclude>
                <exclude>yarn.lock</exclude>
                <exclude>yarn-error.log</exclude>
                <exclude>.editorconfig</exclude>
                <exclude>.cache/**</exclude>
                <exclude>.m2/**</exclude>
                <exclude>**/.ci-friendly-pom.xml</exclude>
                <exclude>.husky/**</exclude>
              </excludes>
            </licenseSet>
          </licenseSets>
          <mapping>
            <tag>DYNASCRIPT_STYLE</tag>
          </mapping>
        </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>src/main/assembly/assembly.xml</descriptor>
              </descriptors>
              <appendAssemblyId>false</appendAssemblyId>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <version>${frontend-maven-plugin.version}</version>
        <executions>
          <execution>
            <id>install node and yarn</id>
            <goals>
              <goal>install-node-and-yarn</goal>
            </goals>
            <configuration>
              <nodeVersion>${frontend-node.version}</nodeVersion>
              <yarnVersion>${frontend-yarn.version}</yarnVersion>
            </configuration>
          </execution>
          <execution>
            <id>yarn</id>
            <goals>
              <goal>yarn</goal>
            </goals>
            <configuration>
              <arguments>install --frozen-lockfile</arguments>
            </configuration>
          </execution>
          <execution>
            <id>yarn build</id>
            <goals>
              <goal>yarn</goal>
            </goals>
            <configuration>
              <arguments>build</arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>prepare-package</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${basedir}/target/classes/META-INF/resources/plugin/gitlab-bugtracker</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.basedir}/dist/gitlab-bugtracker</directory>
                </resource>
              </resources>
            </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>
      <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>
  </build>
  <profiles>
    <profile>
      <id>no-front</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.eirslett</groupId>
            <artifactId>frontend-maven-plugin</artifactId>
            <version>${frontend-maven-plugin.version}</version>
            <executions>
              <execution>
                <id>install node and yarn</id>
                <phase>none</phase>
              </execution>
              <execution>
                <id>yarn</id>
                <phase>none</phase>
              </execution>
              <execution>
                <id>yarn build</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <repositories>
    <repository>
      <id>squash-release</id>
      <url>http://repo.squashtest.org/maven2/releases</url>
    </repository>
    <repository>
      <id>squash-snapshot</id>
      <url>http://repo.squashtest.org/maven2/snapshots</url>
    </repository>
  </repositories>
  <dependencies>
    <dependency>
      <groupId>org.squashtest.tm</groupId>
      <artifactId>core.bugtracker.api</artifactId>
      <version>13.0.2.RC2</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.squashtest.tm</groupId>
      <artifactId>core.api</artifactId>
      <version>13.0.2.RC2</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.squashtest.tm</groupId>
      <artifactId>core.foundation</artifactId>
      <version>13.0.2.RC2</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.squashtest.tm</groupId>
      <artifactId>tm.domain</artifactId>
      <version>13.0.2.RC2</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.squashtest.tm</groupId>
      <artifactId>tm.service</artifactId>
      <version>13.0.2.RC2</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>2.0.17</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
      <version>6.2.15</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
      <version>6.2.15</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>5.12.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>junit-jupiter-params</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-jupiter-engine</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>5.17.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>byte-buddy-agent</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
        <exclusion>
          <artifactId>objenesis</artifactId>
          <groupId>org.objenesis</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>
    <google-java-format.version>1.28.0</google-java-format.version>
    <maven-release-plugin.version>3.1.1</maven-release-plugin.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <squash.core.version>13.0.2.RC2</squash.core.version>
    <ci-friendly.version>1.0.28</ci-friendly.version>
    <frontend-node.version>v22.18.0</frontend-node.version>
    <java.version>21</java.version>
    <maven-shade-plugin.version>3.6.1</maven-shade-plugin.version>
    <maven-compiler-plugin.version>3.14.1</maven-compiler-plugin.version>
    <frontend-maven-plugin.version>1.15.1</frontend-maven-plugin.version>
    <maven-assembly-plugin.version>3.7.1</maven-assembly-plugin.version>
    <revision>13.0.2</revision>
    <spotless-maven-plugin.version>3.0.0</spotless-maven-plugin.version>
    <sonar.projectKey>${project.groupId}:${project.artifactId}${env.APPEND_SONAR_PROJECT_KEY}</sonar.projectKey>
    <maven-surefire-plugin.version>3.5.4</maven-surefire-plugin.version>
    <changelist>-SNAPSHOT</changelist>
    <frontend-yarn.version>v1.22.22</frontend-yarn.version>
    <license-maven-plugin.version>5.0.0</license-maven-plugin.version>
    <gitlab4j-api.version>6.0.0-rc.10</gitlab4j-api.version>
  </properties>
</project>
