<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2021-2025 gematik GmbH
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  ~ *******
  ~
  ~ For additional notes and disclaimer from gematik and in case of changes by gematik find details in the "Readme" file.
  ~
  -->
<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>de.gematik.test</groupId>
  <artifactId>tiger-starter-parent</artifactId>
  <version>4.3.1</version>
  <packaging>pom</packaging>
  <name>tiger-starter-parent</name>
  <description>Parent pom for getting a tiger test suite project quickly up and running</description>
  <url>https://github.com/gematik/app-Tiger</url>

  <licenses>
    <license>
      <name>Apache License 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>gematik</name>
      <email>software-development@gematik.de</email>
      <url>https://gematik.github.io/</url>
      <organization>gematik GmbH</organization>
      <organizationUrl>https://www.gematik.de/</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/gematik/app-Tiger.git</connection>
    <developerConnection>scm:git:ssh://git@github.com:gematik/app-Tiger.git</developerConnection>
    <url>https://github.com/gematik/app-Tiger</url>
  </scm>

  <properties>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <version.maven.failsafe>3.5.4</version.maven.failsafe>
    <tiger.featuresDir>${basedir}/src/test/resources/features</tiger.featuresDir>
    <tiger.glues>${project.groupId}</tiger.glues>
    <version.central-publishing-maven-plugin>0.10.0</version.central-publishing-maven-plugin>
    <version.maven.javadoc>3.12.0</version.maven.javadoc>
    <version.exec-maven-plugin>3.6.3</version.exec-maven-plugin>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>de.gematik.test</groupId>
        <artifactId>tiger-bom</artifactId>
        <version>4.3.1</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>de.gematik.test</groupId>
      <artifactId>tiger-test-lib</artifactId>
    </dependency>
  </dependencies>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${version.maven.failsafe}</version>
        </plugin>
        <plugin>
          <groupId>de.gematik.test</groupId>
          <artifactId>tiger-maven-plugin</artifactId>
          <version>4.3.1</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>de.gematik.test</groupId>
        <artifactId>tiger-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-tiger-drivers</id>
            <goals>
              <goal>generate-drivers</goal>
              <goal>attach-tiger-agent</goal>
            </goals>
            <phase>generate-test-sources</phase>
            <configuration>
              <glues>
                <glue>${tiger.glues}</glue>
              </glues>
              <featuresDir>${tiger.featuresDir}</featuresDir>
            </configuration>
          </execution>
          <execution>
            <id>tiger-report</id>
            <goals>
              <goal>generate-serenity-reports</goal>
              <goal>check-report</goal>
            </goals>
            <phase>post-integration-test</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <configuration>
          <forkedProcessExitTimeoutInSeconds>18000</forkedProcessExitTimeoutInSeconds>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>tiger-ui</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>${version.exec-maven-plugin}</version>
            <configuration>
              <mainClass>io.cucumber.junit.TigerCucumberRunner</mainClass>
              <arguments>
                <argument>--tiger.glues</argument>
                <argument>${tiger.glues}</argument>
                <argument>${tiger.featuresDir}</argument>
              </arguments>
              <systemProperties>
                <systemProperty>
                  <key>TIGER_LIB_ACTIVATEWORKFLOWUI</key>
                  <value>true</value>
                </systemProperty>
                <systemProperty>
                  <key>TIGER_LIB_RUNTESTSONSTART</key>
                  <value>false</value>
                </systemProperty>
              </systemProperties>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>java</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>external</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.8</version>
            <inherited>false</inherited>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <goals>
                  <goal>sign</goal>
                </goals>
                <phase>verify</phase>
                <configuration>
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>${version.central-publishing-maven-plugin}</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
              <autoPublish>true</autoPublish>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.4.0</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${version.maven.javadoc}</version>
            <configuration>
              <doclint>none</doclint>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
