<?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">
    <parent>
        <groupId>io.quarkiverse.googlecloudservices</groupId>
        <artifactId>quarkus-google-cloud-firebase-devservices-parent</artifactId>
        <version>2.15.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>quarkus-google-cloud-firebase-devservices-deployment</artifactId>
    <name>Quarkus - Google Cloud Services - Firebase Dev Services - Deployment</name>

    <dependencies>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-core-deployment</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkiverse.googlecloudservices</groupId>
            <artifactId>quarkus-google-cloud-common-deployment</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkiverse.googlecloudservices</groupId>
            <artifactId>quarkus-google-cloud-firebase-devservices</artifactId>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers</artifactId>
        </dependency>
        <!-- Used to detect current OS for automatic uid/gid detection -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>

        <!-- Test dependencies -->
        <!-- https://mvnrepository.com/artifact/org.testcontainers/junit-jupiter -->
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.firebase</groupId>
            <artifactId>firebase-admin</artifactId>
            <scope>test</scope>
            <exclusions>
                <!-- We exclude the grpc-netty-shaded library as grpc-netty is included via
quarkus-google-cloud-common-grpc and Quarkus includes the netty library -->
                <exclusion>
                    <groupId>io.grpc</groupId>
                    <artifactId>grpc-netty-shaded</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-grpc-common</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkiverse.googlecloudservices</groupId>
            <artifactId>quarkus-google-cloud-common-grpc</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.cloud</groupId>
            <artifactId>google-cloud-firestore</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.annotation</groupId>
                    <artifactId>javax.annotation-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.checkerframework</groupId>
                    <artifactId>checker-qual</artifactId>
                </exclusion>
                <!-- We exclude the grpc-netty-shaded library and include only the grpc-netty
                one (coming from quarkus-google-cloud-common-grpc) as netty is already included with Quarkus -->
                <exclusion>
                    <groupId>io.grpc</groupId>
                    <artifactId>grpc-netty-shaded</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>animal-sniffer-annotations</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.google.cloud</groupId>
            <artifactId>google-cloud-pubsub</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.annotation</groupId>
                    <artifactId>javax.annotation-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.checkerframework</groupId>
                    <artifactId>checker-qual</artifactId>
                </exclusion>
                <!-- We exclude the grpc-netty-shaded library as grpc-netty is included via
                quarkus-google-cloud-common-grpc and Quarkus includes the netty library -->
                <exclusion>
                    <groupId>io.grpc</groupId>
                    <artifactId>grpc-netty-shaded</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>animal-sniffer-annotations</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>io.quarkus</groupId>
                            <artifactId>quarkus-extension-processor</artifactId>
                            <version>${quarkus.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jsonschema2pojo</groupId>
                <artifactId>jsonschema2pojo-maven-plugin</artifactId>
                <version>1.2.2</version>
                <configuration>
                    <sourceDirectory>${basedir}/src/main/resources/META-INF/schema</sourceDirectory>
                    <targetPackage>io.quarkiverse.googlecloudservices.firebase.deployment.testcontainers.json</targetPackage>
                    <annotationStyle>jackson2</annotationStyle>
                    <generateBuilders>true</generateBuilders>

                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>0.45.1</version>
                <executions>
                    <execution>
                        <id>npm-install-before-testing</id>
                        <goals>
                            <goal>stop</goal>
                            <goal>start</goal>
                        </goals>
                        <phase>process-test-resources</phase>
                        <configuration>
                            <images>
                                <image>
                                    <!-- Node version must match version in package.json -->
                                    <name>node:20</name>
                                    <run>
                                        <cmd>npm install</cmd>
                                        <workingDir>/tmp/node</workingDir>
                                        <volumes>
                                            <bind>
                                                <volume>src/test/functions:/tmp/node</volume>
                                            </bind>
                                        </volumes>
                                        <wait>
                                            <exit>0</exit>
                                        </wait>
                                    </run>
                                </image>
                            </images>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>