<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2018 Confluent Inc.
  ~
  ~ Licensed under the Confluent Community License (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.confluent.io/confluent-community-license
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  ~ WARRANTIES 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">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <artifactId>ksqldb-parent</artifactId>
    <groupId>io.confluent.ksql</groupId>
    <version>7.7.8</version>
  </parent>

  <artifactId>ksqldb-docker</artifactId>

  <properties>
    <air.main.basedir>${project.parent.basedir}</air.main.basedir>
    <docker.skip-build>${skip.docker.build}</docker.skip-build>
    <docker.skip-test>${skip.docker.test}</docker.skip-test>
  </properties>

  <dependencies>
    <dependency>
      <groupId>io.confluent.ksql</groupId>
      <artifactId>ksqldb-rest-app</artifactId>
      <version>${io.confluent.ksql.version}</version>
    </dependency>

    <dependency>
      <groupId>io.confluent.ksql</groupId>
      <artifactId>ksqldb-cli</artifactId>
      <version>${io.confluent.ksql.version}</version>
    </dependency>

    <dependency>
      <groupId>io.confluent.ksql</groupId>
      <artifactId>ksqldb-functional-tests</artifactId>
      <version>${io.confluent.ksql.version}</version>
    </dependency>

    <dependency>
      <groupId>io.confluent.ksql</groupId>
      <artifactId>ksqldb-tools</artifactId>
      <version>${io.confluent.ksql.version}</version>
    </dependency>

    <!-- Need to explicitly add dependencies with classifier as they are not automatically pulled
         in. -->
    <dependency>
      <groupId>org.apache.kafka</groupId>
      <artifactId>kafka-clients</artifactId>
      <version>${kafka.version}</version>
      <classifier>test</classifier>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.kafka</groupId>
      <artifactId>kafka_${kafka.scala.version}</artifactId>
      <classifier>test</classifier>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-all</artifactId>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>compile</scope>
    </dependency>

  </dependencies>


  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptors>
            <descriptor>src/assembly/package.xml</descriptor>
          </descriptors>
          <attach>false</attach>
        </configuration>
        <executions>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.spotify</groupId>
        <artifactId>dockerfile-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>package</id>
            <goals>
              <goal>build</goal>
              <goal>push</goal>
            </goals>
            <configuration>
              <repository>${docker.registry}confluentinc/${project.artifactId}</repository>
              <tag>${docker.tag}</tag>
              <buildArgs>
                <DOCKER_UPSTREAM_REGISTRY>${docker.upstream-registry}</DOCKER_UPSTREAM_REGISTRY>
                <DOCKER_UPSTREAM_TAG>${docker.upstream-tag}</DOCKER_UPSTREAM_TAG>
              </buildArgs>
              <skip>${docker.skip-build}</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
