<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>
        <groupId>io.camunda.connector</groupId>
        <artifactId>connector-parent</artifactId>
        <version>0.2.0</version>
        <relativePath/>
    </parent>

    <name>connector-http-json</name>
    <description>Camunda Cloud HTTP JSON Connector</description>
    <groupId>io.camunda</groupId>
    <artifactId>connector-http-json</artifactId>
    <version>0.9.0-rc1</version>
    <packaging>jar</packaging>

    <properties>
        <version.google-libraries-bom>26.1.2</version.google-libraries-bom>
        <version.gson-extras>1.0.0</version.gson-extras>
        <version.httpcore>4.4.15</version.httpcore>
    </properties>

    <repositories>
        <repository>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <id>connectors</id>
            <name>Connectors Repository</name>
            <url>https://artifacts.camunda.com/artifactory/connectors/</url>
        </repository>

        <repository>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <id>connectors-snapshots</id>
            <name>Connectors Snapshot Repository</name>
            <url>https://artifacts.camunda.com/artifactory/connectors-snapshots/</url>
        </repository>
    </repositories>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.google.cloud</groupId>
                <artifactId>libraries-bom</artifactId>
                <version>${version.google-libraries-bom}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>io.camunda.connector</groupId>
            <artifactId>connector-core</artifactId>
        </dependency>

        <dependency>
            <groupId>io.camunda.connector</groupId>
            <artifactId>connector-validation</artifactId>
        </dependency>

        <dependency>
            <groupId>org.danilopianini</groupId>
            <artifactId>gson-extras</artifactId>
            <version>${version.gson-extras}</version>
        </dependency>

        <dependency>
            <groupId>com.google.http-client</groupId>
            <artifactId>google-http-client-gson</artifactId>
        </dependency>

        <dependency>
            <groupId>com.google.http-client</groupId>
            <artifactId>google-http-client-apache-v2</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
            <version>${version.httpcore}</version>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>

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

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

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>cloud-function</id>
            <repositories>
                <repository>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                    <id>connectors</id>
                    <name>Connectors Repository</name>
                    <url>https://artifacts.camunda.com/artifactory/connectors-internal/</url>
                </repository>

                <repository>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                    <id>connectors-snapshots</id>
                    <name>Connectors Snapshot Repository</name>
                    <url>https://artifacts.camunda.com/artifactory/connectors-internal-snapshots/</url>
                </repository>
            </repositories>
            <dependencies>
                <dependency>
                    <groupId>io.camunda.connector</groupId>
                    <artifactId>connector-runtime-cloud</artifactId>
                    <version>0.2.0</version>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-shade-plugin</artifactId>
                        <configuration>
                            <outputFile>${project.build.directory}/deployment/${project.build.finalName}.jar</outputFile>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>com.google.cloud.functions</groupId>
                        <artifactId>function-maven-plugin</artifactId>
                        <configuration>
                            <functionTarget>io.camunda.connector.runtime.cloud.CloudConnectorFunction</functionTarget>
                            <port>9082</port>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
