<?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>
  <parent>
    <groupId>de.gematik.test</groupId>
    <artifactId>tiger-bom</artifactId>
    <version>4.2.5</version>
    <relativePath>./tiger-bom/pom.xml</relativePath>
  </parent>
  <artifactId>tiger</artifactId>

  <packaging>pom</packaging>
  <name>Tiger-Testframework</name>
  <description>Tiger is a test platform. For more info check our project at GitHub
        https://github.com/gematik/app-Tiger</description>

  <url>https://github.com/gematik/app-Tiger</url>
  <inceptionYear>2021</inceptionYear>

  <organization>
    <name>gematik GmbH</name>
    <url>http://www.gematik.de</url>
  </organization>

  <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>

  <modules>
    <!-- tiger-bom has explicitly no parent defined. It must stay here as the first entry of the modules list -->
    <module>tiger-bom</module>
    <module>tiger-starter-parent</module>
    <module>tiger-common</module>
    <module>tiger-httpbin</module>
    <module>tiger-rbel</module>
    <module>tiger-test-utils</module>
    <module>tiger-java-agent</module>
    <module>tiger-proxy</module>
    <module>tiger-proxy-scrollable-webui</module>
    <module>tiger-standalone-proxy</module>
    <module>tiger-testenv-mgr</module>
    <module>tiger-test-lib</module>
    <module>tiger-maven-plugin</module>
    <module>tiger-uitests</module>
    <module>tiger-spotless-cli</module>
  </modules>

  <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>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/gematik/app-Tiger/issues</url>
  </issueManagement>

  <properties>
    <asciidoctor.skip>true</asciidoctor.skip>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <mycila.license-maven-plugin.version>5.0.0</mycila.license-maven-plugin.version>
    <skipSurefire>false</skipSurefire>
    <sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/../tiger-coverage/target/site/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
    <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
    <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
    <sonar.language>java</sonar.language>
    <yarnAuditAnalyzerEnabled>false</yarnAuditAnalyzerEnabled>
  </properties>

  <repositories>
    <repository>
      <id>jenkins-ci</id>
      <url>https://repo.jenkins-ci.org/releases/</url>
    </repository>
    <repository>
      <id>clojars</id>
      <url>https://clojars.org/repo/</url>
    </repository>
  </repositories>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${version.maven-deploy-plugin}</version>
        </plugin>
        <plugin>
          <groupId>net.serenity-bdd.maven.plugins</groupId>
          <artifactId>serenity-maven-plugin</artifactId>
          <version>${version.serenity.maven.plugin}</version>
          <configuration>
            <reports>single-page-html</reports>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>net.serenity-bdd</groupId>
              <artifactId>serenity-core</artifactId>
              <version>${version.serenity.core}</version>
            </dependency>
            <dependency>
              <groupId>net.serenity-bdd</groupId>
              <artifactId>serenity-single-page-report</artifactId>
              <version>${version.serenity.maven.plugin}</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <goals>
                <goal>aggregate</goal>
                <goal>reports</goal>
                <goal>check</goal>
              </goals>
              <phase>post-integration-test</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${version.jacoco-maven-plugin}</version>
          <executions>
            <execution>
              <id>pre-unit-test</id>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
              <configuration>
                <destFile>${project.build.directory}/coverage-reports/jacoco.exec</destFile>
                <propertyName>surefireJacocoAgent</propertyName>
              </configuration>
            </execution>
            <execution>
              <id>pre-integration-test</id>
              <goals>
                <goal>prepare-agent-integration</goal>
              </goals>
              <configuration>
                <destFile>${project.build.directory}/coverage-reports/jacoco-it.exec</destFile>
                <propertyName>failsafeJacocoAgent</propertyName>
              </configuration>
            </execution>
            <execution>
              <id>post-unit-test</id>
              <goals>
                <goal>report</goal>
              </goals>
              <phase>test</phase>
              <configuration>
                <dataFile>${project.build.directory}/coverage-reports/jacoco.exec</dataFile>
                <outputDirectory>${project.reporting.outputDirectory}/jacoco</outputDirectory>
              </configuration>
            </execution>
            <execution>
              <id>post-integration-test</id>
              <goals>
                <goal>report-integration</goal>
              </goals>
              <configuration>
                <dataFile>${project.build.directory}/coverage-reports/jacoco-it.exec</dataFile>
                <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.sonarsource.scanner.maven</groupId>
          <artifactId>sonar-maven-plugin</artifactId>
          <version>5.5.0.6356</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${version.maven-compiler-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${version.maven.surefire}</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.sonarsource.scanner.maven</groupId>
        <artifactId>sonar-maven-plugin</artifactId>
        <version>5.5.0.6356</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>${maven.compiler.source}</source>
          <target>${maven.compiler.target}</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok-maven-plugin</artifactId>
        <version>1.18.20.0</version>
        <dependencies>
          <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${version.lombok}</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <goals>
              <goal>delombok</goal>
            </goals>
            <phase>generate-sources</phase>
            <configuration>
              <addOutputDirectory>false</addOutputDirectory>
              <sourceDirectory>src/main/java</sourceDirectory>
              <outputDirectory>${project.build.directory}/delombok</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <argLine>${surefireJacocoAgent}
                        --add-opens java.base/java.lang=ALL-UNNAMED
                        --add-opens java.base/java.io=ALL-UNNAMED
                        --add-opens java.base/java.util=ALL-UNNAMED
                        -Dfile.encoding=${project.build.sourceEncoding}</argLine>
          <properties>
            <property>
              <name>listener</name>
              <value>org.sonar.java.jacoco.JUnitListener</value>
            </property>
          </properties>
          <excludedGroups>${excludedTestGroups}</excludedGroups>
          <excludes>
            <exclude>**/integrationtest/Test*.java</exclude>
          </excludes>
          <skip>${skipSurefire}</skip>
          <rerunFailingTestsCount>0</rerunFailingTestsCount>
          <reportFormat>plain</reportFormat>
          <trimStackTrace>false</trimStackTrace>
          <useFile>false</useFile>

        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>${version.maven.failsafe}</version>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
            <configuration>
              <argLine>${failsafeJacocoAgent}</argLine>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>${version.spotless-maven-plugin}</version>
        <configuration>
          <formats>
            <format>
              <includes>
                <include>**/*.yml</include>
              </includes>
              <excludes>
                <exclude>**/target/**/*</exclude>
                <exclude>**/node_modules/**/*</exclude>
              </excludes>
              <trimTrailingWhitespace/>
              <endWithNewline/>
              <indent>
                <spaces>true</spaces>
                <spacesPerTab>2</spacesPerTab>
              </indent>
            </format>
          </formats>
          <java>
            <toggleOffOn/>
            <googleJavaFormat>
              <version>${version.spotless.google-java-format}</version>
              <style>GOOGLE</style>
              <reflowLongStrings>true</reflowLongStrings>
            </googleJavaFormat>
          </java>
          <groovy>
            <includes>
              <include>**/*.Jenkinsfile</include>
            </includes>
            <importOrder/>
          </groovy>
          <markdown>
            <includes>
              <include>**/*.md</include>
            </includes>
            <excludes>
              <exclude>**/target/**/*</exclude>
              <exclude>**/node_modules/**/*</exclude>
            </excludes>
          </markdown>
          <pom>
            <sortPom>
              <expandEmptyElements>false</expandEmptyElements>
              <sortDependencies>scope,groupId,artifactId</sortDependencies>
              <sortDependencyExclusions>groupId,artifactId</sortDependencyExclusions>
              <sortProperties>true</sortProperties>
              <lineSeparator>\n</lineSeparator>
              <nrOfIndentSpace>4</nrOfIndentSpace>
              <indentAttribute>schemaLocation</indentAttribute>
            </sortPom>
          </pom>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>${mycila.license-maven-plugin.version}</version>
        <configuration>
          <licenseSets>
            <licenseSet>
              <header>license.header.txt</header>
              <includes>
                <include>**/target/**</include>
                <include>**/src/**</include>
                <include>**/target/generated-*/**</include>
              </includes>
              <excludes>
                <exclude>**/*.properties</exclude>
                <exclude>**/*.yaml</exclude>
                <exclude>**/*.yml</exclude>
                <exclude>**/*.xml</exclude>
                <exclude>**/*.txt</exclude>
                <exclude>**/*.cert</exclude>
                <exclude>**/*.tgr</exclude>
                <exclude>**/*.mjs</exclude>
                <exclude>**/*.bks</exclude>
                <exclude>**/*.crt</exclude>
                <exclude>**/*.browserslistrc</exclude>
                <exclude>**/*.factories</exclude>
                <exclude>**/*.feature</exclude>
                <exclude>**/*.jtmpl</exclude>
                <exclude>**/*.ansi</exclude>
                <exclude>**/*.curl</exclude>
                <exclude>**/*.map</exclude>
                <exclude>**/*.env</exclude>
                <exclude>**/*.pem</exclude>
                <exclude>**/*.eml</exclude>
                <exclude>**/*.bin</exclude>
                <exclude>**/*.b64</exclude>
                <exclude>**/*.p8</exclude>
                <exclude>**/*.encrypted</exclude>
                <exclude>**/*.base64</exclude>
                <exclude>**/*.pkcs8</exclude>
                <exclude>**/*.conf</exclude>
                <exclude>**/*.key</exclude>
                <exclude>**/dist/assets/*</exclude>
                <exclude>**/bootstrap.min.css</exclude>
                <exclude>**/bootstrap.bundle.min.js</exclude>
              </excludes>
              <useDefaultExcludes>true</useDefaultExcludes>
            </licenseSet>
          </licenseSets>
          <skipExistingHeaders>true</skipExistingHeaders>
          <mapping>
            <vue>XML_STYLE</vue>
          </mapping>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin-git</artifactId>
            <!-- make sure you use the same version as license-maven-plugin -->
            <version>${mycila.license-maven-plugin.version}</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>license headers for sources</id>
            <goals>
              <goal>format</goal>
            </goals>
            <phase>generate-sources</phase>
          </execution>
          <execution>
            <id>license headers for test sources</id>
            <goals>
              <goal>format</goal>
            </goals>
            <phase>generate-test-sources</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.6.2</version>
        <executions>
          <execution>
            <id>default-cli</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <dependencyConvergence/>
                <banDuplicatePomDependencyVersions/>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${version.maven.javadoc}</version>
        <reportSets>
          <reportSet>
            <id>default</id>
            <reports>
              <report>javadoc</report>
              <report>test-javadoc</report>
            </reports>
          </reportSet>
          <reportSet>
            <id>aggregate</id>
            <reports>
              <report>aggregate</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>

  <profiles>
    <profile>
      <id>Kotlin</id>
      <activation>
        <file>
          <exists>src/main/kotlin</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-maven-plugin</artifactId>
            <version>${version.kotlin}</version>
            <executions>
              <execution>
                <id>compile</id>
                <goals>
                  <goal>compile</goal>
                </goals>
                <phase>compile</phase>
                <configuration>
                  <jvmTarget>17</jvmTarget>
                  <sourceDirs>
                    <sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
                    <sourceDir>${project.basedir}/src/main/java</sourceDir>
                  </sourceDirs>
                </configuration>
              </execution>
              <execution>
                <id>test-compile</id>
                <goals>
                  <goal>test-compile</goal>
                </goals>
                <phase>test-compile</phase>
                <configuration>
                  <jvmTarget>17</jvmTarget>
                  <sourceDirs>
                    <sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
                    <sourceDir>${project.basedir}/src/test/java</sourceDir>
                  </sourceDirs>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <!-- make sure maven-compiler runs after Kotlin and only compiles Java sources -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${version.maven-compiler-plugin}</version>
            <configuration>
              <source>${maven.compiler.source}</source>
              <target>${maven.compiler.target}</target>
            </configuration>
            <executions>
              <!-- Replacing default-compile as it is treated specially by Maven -->
              <execution>
                <id>default-compile</id>
                <phase>none</phase>
              </execution>
              <!-- Replacing default-testCompile as it is treated specially by Maven -->
              <execution>
                <id>default-testCompile</id>
                <phase>none</phase>
              </execution>
              <execution>
                <id>java-compile</id>
                <goals>
                  <goal>compile</goal>
                </goals>
                <phase>compile</phase>
              </execution>
              <execution>
                <id>java-test-compile</id>
                <goals>
                  <goal>testCompile</goal>
                </goals>
                <phase>test-compile</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>NoLongrunner</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <cucumber.filter.tags>not @FullTests</cucumber.filter.tags>
        <excludedTestGroups>de.gematik.test.tiger.common.LongRunnerTest</excludedTestGroups>
      </properties>
    </profile>
    <profile>
      <id>WithLongrunner</id>
      <properties>
        <!--suppress UnresolvedMavenProperty -->
        <cucumber.filter.tags>@UnitTest or @UiTests</cucumber.filter.tags>
      </properties>
    </profile>
    <profile>
      <id>dev</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <modules>
        <module>tiger-coverage</module>
        <module>tiger-integration-example</module>
      </modules>
    </profile>
    <profile>
      <id>userManual</id>
      <modules>
        <module>tiger-test-lib</module>
      </modules>
      <properties>
        <asciidoctor.skip>false</asciidoctor.skip>
        <mvn.asciidoc.css.style>gematik</mvn.asciidoc.css.style>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>external</id>
      <properties>
        <asciidoctor.skip>false</asciidoctor.skip>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.8</version>
            <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.3.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.jetbrains.dokka</groupId>
            <artifactId>dokka-maven-plugin</artifactId>
            <version>${version.dokka-maven-plugin}</version>
            <configuration>
              <sourceDirectories>
                <dir>${project.basedir}/src/main/kotlin</dir>
                <dir>${project.build.directory}/delombok</dir>
              </sourceDirectories>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>javadocJar</goal>
                </goals>
                <phase>package</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>install-git-hooks</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>${version.exec-maven-plugin}</version>
            <executions>
              <execution>
                <id>install-git-hooks</id>
                <goals>
                  <goal>exec</goal>
                </goals>
                <phase>initialize</phase>
                <configuration>
                  <executable>sh</executable>
                  <arguments>
                    <argument>githooks/setup-git-hooks.sh</argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>release-tools</id>
      <activation>
        <file>
          <exists>releasenotes/scripts/pom.xml</exists>
        </file>
      </activation>
      <modules>
        <module>releasenotes/scripts</module>
      </modules>
    </profile>
  </profiles>
</project>
