<?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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <organization>
    <name>Jexxa Projects</name>
    <url>https://github.com/jexxa-projects</url>
  </organization>

  <groupId>io.jexxa.adapters</groupId>
  <artifactId>esp-adapters</artifactId>
  <version>2.0.2</version>
  <packaging>pom</packaging>
  <name>ESP Adapters (Parent)</name>
  <url>https://github.com/jexxa-projects/ESPAdapters</url>

  <description>ESPAdapters - Adapters for Event Stream Processing in Jexxa and JLegMed</description>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Michael Repplinger</name>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:https://github.com/jexxa-projects/ESPAdapters.git</connection>
    <url>https://github.com/jexxa-projects/ESPAdapters</url>
    <developerConnection>scm:git:https://github.com/jexxa-projects/ESPAdapters.git</developerConnection>
    <tag>esp-adapters-2.0.2</tag>
  </scm>

  <properties>
    <!-- target/compiler configuration  -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.release>25</maven.compiler.release>

      <!-- version of dependencies -->
    <slf4j.simple.version>2.0.18</slf4j.simple.version>
    <kafka.clients.version>8.2.1-ce</kafka.clients.version>
    <kafka.json.schema.serializer>8.2.1</kafka.json.schema.serializer>
    <apache.commons.lang3>3.20.0</apache.commons.lang3>
    <lz4.java.version>1.11.0</lz4.java.version>
    <jexxa.common.adapters.version>4.1.2</jexxa.common.adapters.version>
    <!-- version of test dependencies -->
    <junit.platform.launcher.version>6.1.0</junit.platform.launcher.version>
    <junit.jupiter.engine.version>6.1.0</junit.jupiter.engine.version>
    <junit.jupiter.params.version>6.1.0</junit.jupiter.params.version>

    <classgraph.version>4.8.184</classgraph.version>
    <awaitility.version>4.3.0</awaitility.version>
    <unirest.java.version>3.14.5</unirest.java.version>
    <!-- server-name used in mavens settings.xml to find to your repository credentials -->
    <project.scm.id>github</project.scm.id>

    <!--information for filtered sources  -->
    <build.timestamp>${maven.build.timestamp}</build.timestamp>
    <maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ssZ</maven.build.timestamp.format>

    <!--version of maven plugins  -->
    <gpg.plugin.version>3.2.8</gpg.plugin.version>
    <maven.clean.plugin>3.5.0</maven.clean.plugin>
    <maven.compiler.plugin>3.15.0</maven.compiler.plugin>
    <maven.deploy.plugin>3.1.4</maven.deploy.plugin>
    <maven.failsafe.plugin>3.5.6</maven.failsafe.plugin>
    <maven.install.plugin>3.1.4</maven.install.plugin>
    <maven.jar.plugin>3.5.0</maven.jar.plugin>
    <maven.resources.plugin>3.5.0</maven.resources.plugin>
    <maven.site.plugin>3.22.0</maven.site.plugin>
    <maven.surefire.plugin>3.5.6</maven.surefire.plugin>
    <maven.release.plugin>3.3.1</maven.release.plugin>
    <maven.jacoco.plugin>0.8.15</maven.jacoco.plugin>
    <maven.reports.plugin>3.9.0</maven.reports.plugin>
    <maven.enforcer.plugin>3.6.3</maven.enforcer.plugin>
    <maven.versions.plugin>2.21.0</maven.versions.plugin>
    <maven.javadoc.plugin>3.12.0</maven.javadoc.plugin>
    <maven.build.helper.version>3.6.1</maven.build.helper.version>
    <maven.jib.plugin>3.4.6</maven.jib.plugin>
    <maven.shade.plugin>3.6.0</maven.shade.plugin>
    <maven.exec.plugin>3.5.1</maven.exec.plugin>
    <maven.central.publishing.plugin>0.10.0</maven.central.publishing.plugin>
    <cyclonedx.maven.plugin.version>2.9.1</cyclonedx.maven.plugin.version>

    <!-- sonar configuration  -->
    <sonar.organization>jexxa-projects</sonar.organization>
    <sonar.host.url>https://sonarcloud.io</sonar.host.url>
    <sonar.moduleKey>${project.artifactId}</sonar.moduleKey>
    <sonar.token>${sonar-login}</sonar.token>
    <sonar.projectKey>jexxa-projects_ESPAdapters</sonar.projectKey>
    <sonar.java.source>25</sonar.java.source>
    <sonar.coverage.jacoco.xmlReportPaths>target/site/jacoco-ut/jacoco.xml,target/site/jacoco-it/jacoco.xml </sonar.coverage.jacoco.xmlReportPaths>
    <sonar.java.libraries>target</sonar.java.libraries>
    <argLine>-Xmx2048m -Xms1024m</argLine>

  </properties>
  <build>
    <pluginManagement>
      <!-- lock down plugins versions to avoid using Maven defaults -->
      <plugins>
        <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>${maven.clean.plugin}</version>
        </plugin>
        <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
        <plugin>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>${maven.enforcer.plugin}</version>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${maven.resources.plugin}</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven.compiler.plugin}</version>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven.surefire.plugin}</version>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${maven.jar.plugin}</version>
        </plugin>
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>${maven.install.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>${maven.reports.plugin}</version>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${maven.deploy.plugin}</version>
          <configuration>
            <skip>true</skip>
          </configuration>
        </plugin>
        <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <version>${maven.site.plugin}</version>
        </plugin>
        <plugin>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>${maven.reports.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>${maven.build.helper.version}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <version>${maven.versions.plugin}</version>
          <configuration>
            <!--suppress UnresolvedMavenProperty -->
            <rulesUri>file:///${session.executionRootDirectory}/mavenVersionRules.xml</rulesUri>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.cyclonedx</groupId>
          <artifactId>cyclonedx-maven-plugin</artifactId>
          <version>${cyclonedx.maven.plugin.version}</version>
          <configuration>
            <projectType>library</projectType>
            <schemaVersion>1.6</schemaVersion>
            <includeBomSerialNumber>true</includeBomSerialNumber>
            <skipNotDeployed>false</skipNotDeployed>
            <outputFormat>all</outputFormat>
            <outputName>bom</outputName>
            <includeBomSerialNumber>true</includeBomSerialNumber>
            <includeCompileScope>true</includeCompileScope>
            <includeProvidedScope>true</includeProvidedScope>
            <includeRuntimeScope>true</includeRuntimeScope>
            <includeSystemScope>true</includeSystemScope>
            <includeTestScope>false</includeTestScope> <!-- KRITIS Fokus liegt auf Runtime-Sicherheit -->
            <includeLicenseText>false</includeLicenseText> <!-- Nur Links/IDs für bessere Lesbarkeit -->
            <outputFormat>all</outputFormat> <!-- Erzeugt JSON und XML -->
            <outputName>bom</outputName>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven.javadoc.plugin.version}</version>
          <configuration>
            <!-- Erstellt die Doku über alle Module hinweg -->
            <show>public</show>
            <nohelp>true</nohelp>
          </configuration>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <resources>
      <resource>
        <directory>esp-adapters-core/src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <executions>
          <execution>
            <id>compile</id>
            <phase>compile</phase>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
          <execution>
            <id>testCompile</id>
            <phase>test-compile</phase>
            <goals>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <compilerArgument>-Xlint:all</compilerArgument>
          <showWarnings>true</showWarnings>
          <showDeprecation>true</showDeprecation>
          <release>${maven.compiler.release}</release>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <configuration>
          <!--suppress UnresolvedMavenProperty -->
          <!-- Property failsafeArgLine is set from failsafe plugin-->
          <argLine>${failsafeArgLine}</argLine>
        </configuration>
        <executions>
          <execution>
            <id>integration-tests</id>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <!--suppress UnresolvedMavenProperty -->
          <!-- Property surefireArgLine wird vom maven-surefire-plugin gesetzt-->
          <argLine>${surefireArgLine}</argLine>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <releaseProfiles>sign-artifacts</releaseProfiles>
          <arguments>-Psign-artifacts</arguments>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${maven.javadoc.plugin}</version>
        <configuration>
          <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
          <tags>
            <tag>
              <name>pre</name>
              <placement>mc</placement>
              <head>Preconditions:</head>
            </tag>
            <tag>
              <name>post</name>
              <placement>mc</placement>
              <head>Postconditions:</head>
            </tag>
            <tag>
              <name>inv</name>
              <placement>t</placement>
              <head>Invariants:</head>
            </tag>
            <tag>
              <name>startuml</name>
              <placement>t</placement>
              <head>Plantuml:</head>
            </tag>
            <tag>
              <name>enduml</name>
              <placement>t</placement>
              <head>Plantuml:</head>
            </tag>
            <tag>
              <name>Optional</name>
              <placement>t</placement>
              <head>Plantuml-Optional:</head>
            </tag>
          </tags>
          <additionalOptions>-Xdoclint:none -Xdoclint:-missing</additionalOptions>
          <additionalJOptions>
            <additionalJOption>-Xdoclint:none</additionalJOption>
            <additionalJOption>-Xdoclint:-missing</additionalJOption>
          </additionalJOptions>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
          <!-- 2. Aggregiertes Javadoc nur im Root (Parent) -->
          <execution>
            <id>aggregate</id>
            <inherited>false</inherited> <!-- WICHTIG: Nur im Parent ausführen -->
            <goals>
              <goal>aggregate-jar</goal>
            </goals>
            <phase>package</phase>
          </execution>
        </executions>
      </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-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>3.6</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>${gpg.plugin.version}</version>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>deploy</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <configuration>
          <nonFilteredFileExtensions>
            <nonFilteredFileExtension>jks</nonFilteredFileExtension>
          </nonFilteredFileExtensions>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
        <version>${maven.central.publishing.plugin}</version>
        <extensions>true</extensions>
        <configuration>
          <publishingServerId>central</publishingServerId>
          <autoPublish>true</autoPublish>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.cyclonedx</groupId>
        <artifactId>cyclonedx-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <!-- 'makeAggregateBom' ist ideal für deine Multi-Modul-Struktur -->
              <goal>makeAggregateBom</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>sign-artifacts</id>
      <activation>
        <property>
          <name>sign</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${gpg.plugin.version}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>integrationTests</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>${maven.failsafe.plugin}</version>
            <configuration>
              <!--suppress UnresolvedMavenProperty -->
              <!-- Property surefireArgLine wird vom maven-failsafe-plugin gesetzt-->
              <argLine>${failsafeArgLine}</argLine>
              <shutdown>kill</shutdown>
            </configuration>
            <executions>
              <execution>
                <id>integration-tests</id>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>${maven.jacoco.plugin}</version>
            <executions>
              <!--
                  Prepares the property pointing to the JaCoCo runtime agent which
                  is passed as VM argument when Maven the Surefire plugin is executed.
              -->
              <execution>
                <id>pre-unit-test</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
                <configuration>
                  <!-- Sets the path to the file which contains the execution data. -->
                  <destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile>
                  <!--
                      Sets the name of the property containing the settings
                      for JaCoCo runtime agent.
                  -->
                  <propertyName>surefireArgLine</propertyName>
                </configuration>
              </execution>
              <!--
                  Ensures that the code coverage report for unit tests is created after
                  unit tests have been run.
              -->
              <execution>
                <id>post-unit-test</id>
                <phase>test</phase>
                <goals>
                  <goal>report</goal>
                </goals>
                <configuration>
                  <!-- Sets the path to the file which contains the execution data. -->
                  <dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</dataFile>
                  <!-- Sets the output directory for the code coverage report. -->
                  <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
                </configuration>
              </execution>
              <execution>
                <id>pre-integration-test</id>
                <phase>pre-integration-test</phase>
                <goals>
                  <goal>prepare-agent-integration</goal>
                </goals>
                <configuration>
                  <!-- Sets the path to the file which contains the execution data. -->
                  <destFile>${project.build.directory}/coverage-reports/jacoco-it.exec</destFile>
                  <!--
                      Sets the name of the property containing the settings
                      for JaCoCo runtime agent.
                  -->
                  <propertyName>failsafeArgLine</propertyName>
                </configuration>
              </execution>
              <!--
                  Ensures that the code coverage report for integration tests after
                  integration tests have been run.
              -->
              <execution>
                <id>post-integration-test</id>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>report</goal>
                </goals>
                <configuration>
                  <!-- Sets the path to the file which contains the execution data. -->
                  <dataFile>${project.build.directory}/coverage-reports/jacoco-it.exec</dataFile>
                  <!-- Sets the output directory for the code coverage report. -->
                  <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
                </configuration>
              </execution>
              <execution>
                <id>post-integration-test-report</id>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>report</goal>
                </goals>
                <configuration>
                  <!-- Sets the path to the file which contains the execution data. -->
                  <dataFile>${project.build.directory}/coverage-reports/jacoco-it.exec</dataFile>
                  <!-- Sets the output directory for the code coverage report. -->
                  <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
                </configuration>
              </execution>
              <execution>
                <id>merge-results</id>
                <phase>verify</phase>
                <goals>
                  <goal>merge</goal>
                </goals>
                <configuration>
                  <fileSets>
                    <fileSet>
                      <directory>${project.build.directory}/coverage-reports</directory>
                      <includes>
                        <include>*.exec</include>
                      </includes>
                    </fileSet>
                  </fileSets>
                  <destFile>${project.build.directory}/coverage-reports/jacoco-aggregate.exec</destFile>
                </configuration>
              </execution>
              <execution>
                <id>post-merge-report</id>
                <phase>verify</phase>
                <goals>
                  <goal>report</goal>
                </goals>
                <configuration>
                  <dataFile>${project.build.directory}/coverage-reports/jacoco-aggregate.exec</dataFile>
                  <outputDirectory>${project.reporting.outputDirectory}/jacoco-aggregate</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <repositories>
    <repository>
      <id>confluent</id>
      <url>https://packages.confluent.io/maven</url>
    </repository>
  </repositories>
  <modules>
    <module>esp-adapters-core</module>
    <module>esp-adapters-test</module>
  </modules>
</project>
