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


  <name>ESPAdapters</name>
  <groupId>io.jexxa.esp</groupId>
  <artifactId>esp-adapters</artifactId>
  <version>0.3.0</version>
  <packaging>pom</packaging>

  <url>https://github.com/jexxa-projects/ESPAdapters</url>

  <description>ESPAdapters - Adapters for Event Stream Processing in Jexxa and JLegMed</description>

  <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-0.3.0</tag>
  </scm>


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

  <properties>

    <!-- version of dependencies -->
    <slf4j.simple.version>2.0.17</slf4j.simple.version>
    <io.jexxa.common-adapters>2.3.0</io.jexxa.common-adapters>
    <kafka.clients.version>8.0.0-ce</kafka.clients.version>
    <kafka.json.schema.serializer>8.0.0</kafka.json.schema.serializer>
    <apache.commons.lang3>3.18.0</apache.commons.lang3>

    <!-- version of test dependencies -->
    <junit.platform.launcher.version>1.13.4</junit.platform.launcher.version>
    <junit.jupiter.engine.version>5.13.4</junit.jupiter.engine.version>
    <junit.jupiter.params.version>5.13.4</junit.jupiter.params.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.14.0</maven.compiler.plugin>
    <maven.deploy.plugin>3.1.4</maven.deploy.plugin>
    <maven.failsafe.plugin>3.5.3</maven.failsafe.plugin>
    <maven.install.plugin>3.1.4</maven.install.plugin>
    <maven.jar.plugin>3.4.2</maven.jar.plugin>
    <maven.resources.plugin>3.3.1</maven.resources.plugin>
    <maven.site.plugin>3.21.0</maven.site.plugin>
    <maven.surefire.plugin>3.5.3</maven.surefire.plugin>
    <maven.release.plugin>3.0.0-M1</maven.release.plugin>
    <maven.jacoco.plugin>0.8.13</maven.jacoco.plugin>
    <maven.reports.plugin>3.9.0</maven.reports.plugin>
    <maven.enforcer.plugin>3.6.1</maven.enforcer.plugin>
    <maven.javadoc.plugin>3.11.2</maven.javadoc.plugin>
    <maven.versions.plugin>2.18.0</maven.versions.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.8.0</maven.central.publishing.plugin>
    <maven.compiler.release>17</maven.compiler.release>

  </properties>


  <!-- ************************************************************************** -->
  <!-- IMPORTANT: Change the following lines only if you are familiar with maven  -->
  <!-- IMPORTANT: If you really need to adjust the following lines, please check      -->
  <!-- IMPORTANT: if you should start your maven project.                         -->
  <!-- ************************************************************************** -->
  <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>
          <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>
      </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>
        </executions>
      </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.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>
    </plugins>

  </build>
  <profiles>
    <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>
