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

  <parent>
    <artifactId>ce-kafka-rest-parent</artifactId>
    <groupId>io.confluent</groupId>
    <version>7.4.14</version>
  </parent>

  <artifactId>ce-kafka-rest-extensions</artifactId>
  <packaging>jar</packaging>

  <licenses>
    <license>
      <name>Confluent License Agreement</name>
      <url>https://www.confluent.io/legal/confluent-license-agreement/</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <dependencies>
    <dependency>
      <groupId>io.confluent</groupId>
      <artifactId>kafka-rest</artifactId>
      <version>${io.confluent.kafka-rest.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>io.confluent</groupId>
      <artifactId>kafka-client-plugins</artifactId>
    </dependency>

    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>

    <!-- Maintain ordering: All non-fips(bcprov-jdk15on) artifacts
           *must* must come before all fips dependencies -->
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcprov-jdk18on</artifactId>
      <scope>provided</scope>
    </dependency>
	  
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcpkix-jdk18on</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bc-fips</artifactId>
    </dependency>

    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcpkix-fips</artifactId>
    </dependency>

    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bctls-fips</artifactId>
    </dependency>

    <dependency>
      <groupId>javax.ws.rs</groupId>
      <artifactId>javax.ws.rs-api</artifactId>
    </dependency>

    <dependency>
      <groupId>io.confluent</groupId>
      <artifactId>kafka-rest</artifactId>
      <version>${io.confluent.kafka-rest.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.confluent</groupId>
      <artifactId>kafka-schema-registry</artifactId>
      <version>${io.confluent.schema-registry.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>${junit.jupiter.version}</version>
      <scope>test</scope>
    </dependency>

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

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

    <dependency>
      <groupId>org.apache.kafka</groupId>
      <artifactId>kafka-clients</artifactId>
      <version>${ce.kafka.version}</version>
    </dependency>

    <dependency>
      <groupId>io.confluent</groupId>
      <artifactId>ce-sbk_${kafka.scala.version}</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.confluent</groupId>
      <artifactId>ce-sbk_${kafka.scala.version}</artifactId>
      <classifier>test</classifier>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.confluent</groupId>
      <artifactId>confluent-security-plugins-common</artifactId>
      <version>${io.confluent.confluent-security-plugins.version}</version>
    </dependency>

    <dependency>
      <groupId>io.confluent</groupId>
      <artifactId>broker-plugins</artifactId>
      <version>${ce.kafka.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>io.confluent</groupId>
      <artifactId>confluent-metrics</artifactId>
      <version>${ce.kafka.version}</version>
      <scope>test</scope>
    </dependency>

    <!--This is to fix scenario where ccs version is getting pulled because it got newer version the ce version.-->
    <dependency>
      <groupId>org.apache.kafka</groupId>
      <artifactId>connect-runtime</artifactId>
      <version>${ce.kafka.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.confluent</groupId>
      <artifactId>confluent-serializers-new</artifactId>
      <version>${ce.kafka.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.kafka</groupId>
      <artifactId>kafka-clients</artifactId>
      <version>${ce.kafka.version}</version>
      <classifier>test</classifier>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-inline</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptors>
            <descriptor>src/assembly/package.xml</descriptor>
          </descriptors>
        </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-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-dependencies</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <includeScope>runtime</includeScope>
              <outputDirectory>${project.build.directory}/package-dependencies</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <annotationProcessorPaths>
            <annotationProcessorPath>
              <groupId>com.google.auto.value</groupId>
              <artifactId>auto-value</artifactId>
            </annotationProcessorPath>
          </annotationProcessorPaths>
        </configuration>
      </plugin>

      <plugin>
	<groupId>com.diffplug.spotless</groupId>
	<artifactId>spotless-maven-plugin</artifactId>
        <executions>
	  <execution>
	    <goals>
	      <goal>check</goal>
	    </goals>
	  </execution>
	</executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <configuration>
          <!--https://stackoverflow.com/questions/65129848/integration-test-fails-when-upgrading-failsafe-but-passes-within-intellij  -->
          <useModulePath>false</useModulePath>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>cloudPackageSmokeTest</id>
      <activation>
          <property>
              <name>KAFKA_REST_CLOUD_SMOKE_TESTS</name>
              <value>true</value>
          </property>
      </activation>
      <build>
        <plugins>
          <!-- skip unit tests -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration combine.self="override">
              <skip>true</skip>
            </configuration>
          </plugin>

          <!-- run just the smoke test -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration combine.self="override">
              <includes>
                <include>**/smoke/**</include>
              </includes>
              <excludes>
                <exclude>**/*$*</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
