<?xml version="1.0" encoding="UTF-8"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements. See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You 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.
-->
<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">

  <parent>
    <groupId>org.apache</groupId>
    <artifactId>apache</artifactId>
    <version>21</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <groupId>org.citrusframework.yaks</groupId>
  <artifactId>yaks-parent</artifactId>
  <version>0.7.0</version>
  <name>YAKS</name>
  <description>Platform to enable Cloud Native BDD testing on Kubernetes</description>
  <packaging>pom</packaging>

  <!-- Metadata need to publish to central -->
  <url>https://citrusframework.org</url>
  <inceptionYear>2020</inceptionYear>

  <organization>
    <name>Red Hat</name>
    <url>https://redhat.com</url>
  </organization>

  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>The YAKS Team</name>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:https://github.com/citrusframework/yaks.git</connection>
    <developerConnection>scm:git:ssh://git@github.com:citrusframework/yaks.git</developerConnection>
    <url>http://github.com/citrusframework/yaks</url>
  </scm>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.release>11</maven.compiler.release>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
    <project.docs.version>${project.version}</project.docs.version>
    <slf4j.version>1.7.30</slf4j.version>
    <log4j2.version>2.16.0</log4j2.version>
    <groovy.version>3.0.8</groovy.version>
    <citrus.version>3.1.0</citrus.version>
    <spring.version>5.3.6</spring.version>
    <cucumber.version>6.10.3</cucumber.version>
    <camel.version>3.10.0</camel.version>
    <jackson.version>2.12.3</jackson.version>
    <junit.version>4.13.2</junit.version>
    <kubernetes-client.version>5.10.1</kubernetes-client.version>
    <knative-client.version>5.10.1</knative-client.version>
    <okhttp.version>4.9.3</okhttp.version>
    <postgresql.version>9.4.1212</postgresql.version>
    <testcontainers.version>1.15.1</testcontainers.version>
    <apicurio.version>1.1.2</apicurio.version>
    <assertj-core.version>3.14.0</assertj-core.version>
    <s3-storage-wagon.version>2.3</s3-storage-wagon.version>
    <activemq.version>5.16.2</activemq.version>
    <activemq.artemis.version>2.17.0</activemq.artemis.version>
    <mockito.version>3.9.0</mockito.version>

    <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
    <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
    <maven-failsafe-plugin.version>2.22.2</maven-failsafe-plugin.version>
    <maven-remote-resources-plugin.version>1.5</maven-remote-resources-plugin.version>
    <versions-maven-plugin.version>2.7</versions-maven-plugin.version>
    <directory-maven-plugin.version>0.3.1</directory-maven-plugin.version>
    <exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
    <mycila-license.version>3.0</mycila-license.version>
    <maven-checkstyle-plugin.version>3.0.0</maven-checkstyle-plugin.version>
    <maven-checkstyle.version>7.6.1</maven-checkstyle.version>

    <skip.gpg>false</skip.gpg>
  </properties>

  <dependencyManagement>
    <dependencies>
      <!-- Fabric8 clients -->
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>kubernetes-client</artifactId>
        <version>${kubernetes-client.version}</version>
      </dependency>
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>kubernetes-server-mock</artifactId>
        <version>${kubernetes-client.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>knative-client</artifactId>
        <version>${knative-client.version}</version>
      </dependency>
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>knative-mock</artifactId>
        <version>${knative-client.version}</version>
        <exclusions>
          <exclusion>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
          </exclusion>
        </exclusions>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>com.squareup.okhttp3</groupId>
        <artifactId>okhttp</artifactId>
        <version>${okhttp.version}</version>
      </dependency>
      <dependency>
        <groupId>com.squareup.okhttp3</groupId>
        <artifactId>mockwebserver</artifactId>
        <version>${okhttp.version}</version>
      </dependency>

      <!-- Citrus -->
      <dependency>
        <groupId>com.consol.citrus</groupId>
        <artifactId>citrus-base</artifactId>
        <version>${citrus.version}</version>
      </dependency>
      <dependency>
        <groupId>com.consol.citrus</groupId>
        <artifactId>citrus-spring</artifactId>
        <version>${citrus.version}</version>
      </dependency>
      <dependency>
        <groupId>com.consol.citrus</groupId>
        <artifactId>citrus-validation-json</artifactId>
        <version>${citrus.version}</version>
      </dependency>
      <dependency>
        <groupId>com.consol.citrus</groupId>
        <artifactId>citrus-validation-text</artifactId>
        <version>${citrus.version}</version>
      </dependency>
      <dependency>
        <groupId>com.consol.citrus</groupId>
        <artifactId>citrus-validation-groovy</artifactId>
        <version>${citrus.version}</version>
      </dependency>
      <dependency>
        <groupId>com.consol.citrus</groupId>
        <artifactId>citrus-validation-hamcrest</artifactId>
        <version>${citrus.version}</version>
      </dependency>
      <dependency>
        <groupId>com.consol.citrus</groupId>
        <artifactId>citrus-http</artifactId>
        <version>${citrus.version}</version>
      </dependency>
      <dependency>
        <groupId>com.consol.citrus</groupId>
        <artifactId>citrus-cucumber</artifactId>
        <version>${citrus.version}</version>
      </dependency>
      <dependency>
        <groupId>com.consol.citrus</groupId>
        <artifactId>citrus-camel</artifactId>
        <version>${citrus.version}</version>
      </dependency>
      <dependency>
        <groupId>com.consol.citrus</groupId>
        <artifactId>citrus-jms</artifactId>
        <version>${citrus.version}</version>
      </dependency>
      <dependency>
        <groupId>com.consol.citrus</groupId>
        <artifactId>citrus-kafka</artifactId>
        <version>${citrus.version}</version>
      </dependency>
      <dependency>
        <groupId>com.consol.citrus</groupId>
        <artifactId>citrus-mail</artifactId>
        <version>${citrus.version}</version>
      </dependency>
      <dependency>
        <groupId>com.consol.citrus</groupId>
        <artifactId>citrus-ws</artifactId>
        <version>${citrus.version}</version>
      </dependency>
      <dependency>
        <groupId>com.consol.citrus</groupId>
        <artifactId>citrus-selenium</artifactId>
        <version>${citrus.version}</version>
      </dependency>
      <dependency>
        <groupId>com.consol.citrus</groupId>
        <artifactId>citrus-sql</artifactId>
        <version>${citrus.version}</version>
      </dependency>

      <!-- Cucumber -->
      <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>${cucumber.version}</version>
      </dependency>
      <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>${cucumber.version}</version>
      </dependency>

      <!-- Spring Framework -->
      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>${spring.version}</version>
      </dependency>
      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>${spring.version}</version>
      </dependency>
      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
        <version>${spring.version}</version>
      </dependency>
      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
        <version>${spring.version}</version>
      </dependency>

      <!-- Apache Camel -->
      <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-bom</artifactId>
        <version>${camel.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-spring</artifactId>
        <version>${camel.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-xml-jaxb-dsl</artifactId>
        <version>${camel.version}</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>${jackson.version}</version>
      </dependency>

      <!-- Import full jackson bom to avoid lib mis-alignment -->
      <dependency>
        <groupId>com.fasterxml.jackson</groupId>
        <artifactId>jackson-bom</artifactId>
        <version>${jackson.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>

      <dependency>
        <groupId>org.yaml</groupId>
        <artifactId>snakeyaml</artifactId>
        <version>1.26</version>
      </dependency>

      <dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy</artifactId>
        <version>${groovy.version}</version>
      </dependency>

      <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>${postgresql.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-dbcp2</artifactId>
        <version>2.7.0</version>
      </dependency>

      <!-- Logging -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>${log4j2.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-slf4j-impl</artifactId>
        <version>${log4j2.version}</version>
      </dependency>

      <!-- Unit testing -->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>${assertj-core.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${mockito.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <!-- Global dependencies -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>

    <!-- Test scope -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j-impl</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven-compiler-plugin.version}</version>
          <configuration>
            <source>${maven.compiler.source}</source>
            <target>${maven.compiler.target}</target>
            <compilerArgs>
              <arg>-Xlint:deprecation</arg>
            </compilerArgs>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <executions>
            <execution>
              <id>attach-sources</id>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <configuration>
            <additionalJOption>-Xdoclint:none</additionalJOption>
          </configuration>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven-surefire-plugin.version}</version>
          <configuration>
            <failIfNoTests>false</failIfNoTests>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${maven-failsafe-plugin.version}</version>
          <executions>
            <execution>
              <id>integration-tests</id>
              <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
              </goals>
              <configuration>
                <failIfNoTests>false</failIfNoTests>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-remote-resources-plugin</artifactId>
          <version>${maven-remote-resources-plugin.version}</version>
          <executions>
            <execution>
              <goals>
                <goal>process</goal>
              </goals>
              <configuration>
                <resourceBundles>
                  <resourceBundle>org.apache:apache-jar-resource-bundle:1.4</resourceBundle>
                </resourceBundles>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>1.6.8</version>
          <configuration>
            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
            <serverId>sonatype-nexus-staging</serverId>
            <stagingProgressTimeoutMinutes>120</stagingProgressTimeoutMinutes>
            <keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <executions>
            <execution>
              <id>sign-artifacts</id>
              <phase>verify</phase>
              <goals>
                <goal>sign</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <useAgent>true</useAgent>
            <keyname>dev@citrusframework.org</keyname>
            <skip>${skip.gpg}</skip>
            <gpgArguments>
              <arg>--allow-weak-digest-algos</arg>
            </gpgArguments>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.asciidoctor</groupId>
          <artifactId>asciidoctor-maven-plugin</artifactId>
          <version>2.1.0</version>
          <inherited>false</inherited>
          <configuration>
            <sourceDirectory>docs</sourceDirectory>
            <sourceDocumentName>index.adoc</sourceDocumentName>
            <attributes>
              <icons>font</icons>
              <pagenums/>
              <version>${project.docs.version}</version>
              <plugindir>${project.basedir}/plugin</plugindir>
              <idprefix/>
              <idseparator>-</idseparator>
              <allow-uri-read>true</allow-uri-read>
              <source-highlighter>prettify</source-highlighter>
            </attributes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-scm-plugin</artifactId>
          <version>1.9.5</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <!-- Default plugins for all modules -->
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <modules>
    <module>steps</module>
    <module>runtime</module>
    <module>tools</module>
  </modules>

  <profiles>
    <!-- Distribution Management -->
    <profile>
      <id>release-central</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>

          <!-- Deploy using the sonatype nexus staging maven plugin -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>

          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>default-deploy</id>
                <phase>deploy</phase>
                <goals>
                  <goal>deploy</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>docs-html</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.asciidoctor</groupId>
            <artifactId>asciidoctor-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>overview-html</id>
                <phase>package</phase>
                <goals>
                  <goal>process-asciidoc</goal>
                </goals>
                <configuration>
                  <sourceDocumentName>overview.adoc</sourceDocumentName>
                  <backend>html</backend>
                </configuration>
              </execution>
              <execution>
                <id>docs-html</id>
                <phase>package</phase>
                <goals>
                  <goal>process-asciidoc</goal>
                </goals>
                <configuration>
                  <backend>html</backend>
                  <attributes>
                    <toc>left</toc>
                    <linkcss>false</linkcss>
                  </attributes>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>docs-pdf</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.asciidoctor</groupId>
            <artifactId>asciidoctor-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>docs-pdf</id>
                <phase>package</phase>
                <goals>
                  <goal>process-asciidoc</goal>
                </goals>
                <configuration>
                  <backend>pdf</backend>
                  <attributes>
                    <toc/>
                    <source-highlighter>rouge</source-highlighter>
                  </attributes>
                </configuration>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>org.asciidoctor</groupId>
                <artifactId>asciidoctorj-pdf</artifactId>
                <version>1.5.3</version>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>release-docs</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-scm-plugin</artifactId>
            <configuration>
              <connectionUrl>scm:git:git@github.com:citrusframework/yaks.git</connectionUrl>
              <developerConnectionUrl>scm:git:git@github.com:citrusframework/yaks.git</developerConnectionUrl>
              <scmVersion>gh-pages</scmVersion>
              <scmVersionType>branch</scmVersionType>
            </configuration>
            <executions>
              <execution>
                <id>gh-pages-clone</id>
                <phase>initialize</phase>
                <goals>
                  <goal>checkout</goal>
                </goals>
              </execution>
              <execution>
                <id>gh-pages-add</id>
                <phase>verify</phase>
                <goals>
                  <goal>add</goal>
                </goals>
                <configuration>
                  <workingDirectory>${project.build.directory}/checkout</workingDirectory>
                  <includes>**/**</includes>
                </configuration>
              </execution>
              <execution>
                <id>gh-pages-push</id>
                <phase>verify</phase>
                <goals>
                  <goal>checkin</goal>
                </goals>
                <configuration>
                  <workingDirectory>${project.build.directory}/checkout</workingDirectory>
                  <message>Update reference manual</message>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
              <execution>
                <id>dist-docs</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <finalName>docs</finalName>
                  <appendAssemblyId>false</appendAssemblyId>
                  <descriptors>
                    <descriptor>docs/dist-docs.xml</descriptor>
                  </descriptors>
                  <attach>false</attach>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <executions>
              <execution>
                <id>copy-docs-sources</id>
                <phase>package</phase>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
                <configuration>
                  <outputDirectory>${project.build.directory}/checkout</outputDirectory>
                  <resources>
                    <resource>
                      <directory>${project.build.directory}/docs</directory>
                      <includes>
                        <include>**/**</include>
                      </includes>
                    </resource>
                  </resources>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>doclint-java8-disable</id>
      <activation>
        <jdk>[1.8,)</jdk>
      </activation>
      <properties>
        <javadoc.opts>-Xdoclint:none</javadoc.opts>
      </properties>
    </profile>

    <profile>
      <id>sourcecheck</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
