<?xml version="1.0"?>
<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>io.debezium</groupId>
        <artifactId>debezium-server</artifactId>
        <version>2.3.3.Final</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>debezium-server-core</artifactId>
    <name>Debezium Server Core</name>
    <packaging>jar</packaging>

    <dependencies>
        <!-- Quarkus extensions -->
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-core</artifactId>
        </dependency>
        <dependency>
            <groupId>io.debezium</groupId>
            <artifactId>debezium-testing-testcontainers</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-smallrye-health</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-resteasy</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-kubernetes-config</artifactId>
        </dependency>

        <dependency>
            <groupId>io.debezium</groupId>
            <artifactId>debezium-api</artifactId>
        </dependency>
        <dependency>
            <groupId>io.debezium</groupId>
            <artifactId>debezium-embedded</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Testing -->
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit5</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope></dependency>
        <dependency>
            <groupId>io.debezium</groupId>
            <artifactId>debezium-core</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.confluent</groupId>
            <artifactId>kafka-connect-avro-converter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.apicurio</groupId>
            <artifactId>apicurio-registry-utils-converter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.confluent</groupId>
            <artifactId>kafka-connect-protobuf-converter</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.google.protobuf</groupId>
                    <artifactId>protobuf-java</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.debezium</groupId>
            <artifactId>debezium-connector-postgres</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- Vitess/grpc dependency conflicts with version required by schema registry.
             We thus change the version just for the sake of compatibility testing.
        -->
        <dependency>
            <groupId>com.google.api.grpc</groupId>
            <artifactId>proto-google-common-protos</artifactId>
            <version>2.5.1</version>
            <scope>test</scope>
        </dependency>
        <!-- kafka-connect-protobuf-converter introduces protobuf 3.22, and this is
             not compatible with schema registry, so we explicitly adjust the version
             here for test compatibility reasons.
        -->
        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>${version.com.google.protobuf}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-maven-plugin</artifactId>
                <version>${quarkus.version.runtime}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>build</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jboss.jandex</groupId>
                <artifactId>jandex-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>make-index</id>
                        <goals>
                            <goal>jandex</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>integration-test</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>verify</id>
                        <goals>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <skipTests>${skipITs}</skipTests>
                    <enableAssertions>true</enableAssertions>
                    <systemProperties>
                        <test.type>IT</test.type>
                        <test.apicurio>false</test.apicurio>
                    </systemProperties>
                    <runOrder>${runOrder}</runOrder>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>assembly</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <version>${version.failsafe.plugin}</version>
                        <configuration>
                            <skipTests>${skipITs}</skipTests>
                            <enableAssertions>true</enableAssertions>
                            <runOrder>${runOrder}</runOrder>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test-apicurio-ext-json</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                                <configuration>
                                    <systemPropertyVariables>
                                        <test.apicurio.converter.format>json</test.apicurio.converter.format>
                                        <test.apicurio>true</test.apicurio>
                                    </systemPropertyVariables>
                                </configuration>
                            </execution>
                            <execution>
                                <id>integration-test-apicurio-avro</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                                <configuration>
                                    <systemPropertyVariables>
                                        <test.apicurio.converter.format>avro</test.apicurio.converter.format>
                                        <test.apicurio>true</test.apicurio>
                                    </systemPropertyVariables>
                                </configuration>
                            </execution>
                            <execution>
                                <id>integration-test-protobuf</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                                <configuration>
                                    <systemPropertyVariables>
                                        <debezium.format.key>protobuf</debezium.format.key>
                                        <debezium.format.value>protobuf</debezium.format.value>
                                    </systemPropertyVariables>
                                </configuration>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>server-ci</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <version>${version.failsafe.plugin}</version>
                        <configuration>
                            <skipTests>${skipITs}</skipTests>
                            <enableAssertions>true</enableAssertions>
                            <runOrder>${runOrder}</runOrder>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test-apicurio-ext-json</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                                <configuration>
                                    <systemPropertyVariables>
                                        <test.apicurio.converter.format>json</test.apicurio.converter.format>
                                        <test.apicurio>true</test.apicurio>
                                    </systemPropertyVariables>
                                </configuration>
                            </execution>
                            <execution>
                                <id>integration-test-apicurio-avro</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                                <configuration>
                                    <systemPropertyVariables>
                                        <test.apicurio.converter.format>avro</test.apicurio.converter.format>
                                        <test.apicurio>true</test.apicurio>
                                    </systemPropertyVariables>
                                </configuration>
                            </execution>
                            <execution>
                                <id>integration-test-protobuf</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                                <configuration>
                                    <systemPropertyVariables>
                                        <debezium.format.key>protobuf</debezium.format.key>
                                        <debezium.format.value>protobuf</debezium.format.value>
                                    </systemPropertyVariables>
                                </configuration>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>apicurio-ext-json</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skipTests>${skipITs}</skipTests>
                            <enableAssertions>true</enableAssertions>
                            <systemPropertyVariables>
                                <test.apicurio.converter.format>json</test.apicurio.converter.format>
                                <test.apicurio>true</test.apicurio>
                            </systemPropertyVariables>
                            <runOrder>${runOrder}</runOrder>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>apicurio-avro</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skipTests>${skipITs}</skipTests>
                            <enableAssertions>true</enableAssertions>
                            <systemPropertyVariables>
                                <test.apicurio.converter.format>avro</test.apicurio.converter.format>
                                <test.apicurio>true</test.apicurio>
                            </systemPropertyVariables>
                            <runOrder>${runOrder}</runOrder>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>schema-registry-protobuf</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skipTests>${skipITs}</skipTests>
                            <enableAssertions>true</enableAssertions>
                            <systemPropertyVariables>
                                <debezium.format.key>protobuf</debezium.format.key>
                                <debezium.format.value>protobuf</debezium.format.value>
                            </systemPropertyVariables>
                            <runOrder>${runOrder}</runOrder>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>quick</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>quick</name>
                </property>
            </activation>
            <properties>
                <skipITs>true</skipITs>
            </properties>
        </profile>
    </profiles>
</project>
