<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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>com.microsoft.azure</groupId>
        <artifactId>azure-spring-boot-starter-parent</artifactId>
        <version>0.1.5</version>
        <relativePath>../../common/azure-spring-boot-starter-parent/pom.xml</relativePath>
    </parent>

    <artifactId>spring-data-azure-documentdb</artifactId>
    <packaging>jar</packaging>

    <name>Azure Document DB Spring Data</name>
    <description>Azure Document DB Spring Data Support</description>
    <url>https://github.com/Microsoft/azure-spring-boot-starters</url>

    <licenses>
        <license>
            <name>MIT</name>
            <url>https://github.com/Microsoft/azure-spring-boot-starters/blob/master/LICENSE</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>yungez</id>
            <name>Yunge Zhu</name>
            <email>yungez@microsoft.com</email>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/Microsoft/azure-spring-boot-starters.git</connection>
        <developerConnection>scm:git:ssh://github.com:Microsoft/azure-spring-boot-starters.git</developerConnection>
        <url>https://github.com/Microsoft/azure-spring-boot-starters/tree/master</url>
    </scm>

    <properties>
        <azure.test.resourcegroup>documentdbtest</azure.test.resourcegroup>
        <azure.test.dbname>springdocdbtestdb</azure.test.dbname>
        <skip.integration.tests>true</skip.integration.tests>
        <test.on.azure>false</test.on.azure>
        <test.on.emualator>false</test.on.emualator>
    </properties>

    <dependencies>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-commons</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-expression</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
        </dependency>

        <dependency>
            <groupId>com.microsoft.azure</groupId>
            <artifactId>azure-spring-common</artifactId>
        </dependency>

        <dependency>
            <groupId>com.microsoft.azure</groupId>
            <artifactId>azure-documentdb</artifactId>
        </dependency>

        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <configuration>
                    <systemPropertiesFile>src/test/resources/application.properties</systemPropertiesFile>
                    <skipITs>${skip.integration.tests}</skipITs>
                </configuration>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>setup</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target if="${test.on.azure}">
                                <ant antfile="build.xml" target="setup">
                                </ant>
                            </target>
                        </configuration>
                    </execution>

                    <execution>
                        <id>cleanup</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target if="${test.on.azure}">
                                <ant antfile="build.xml" target="cleanup"/>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>dev</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <build.profile.id>dev</build.profile.id>
                <skip.integration.tests>true</skip.integration.tests>
                <test.on.azure>false</test.on.azure>
                <test.on.emulator>false</test.on.emulator>
            </properties>
        </profile>
        <profile>
            <id>integration-test-azure</id>
            <properties>
                <build.profile.id>integration-test-azure</build.profile.id>
                <skip.integration.tests>false</skip.integration.tests>
                <test.on.azure>true</test.on.azure>
                <test.on.emulator>false</test.on.emulator>
            </properties>
        </profile>
        <profile>
            <id>integration-test-emulator</id>
            <properties>
                <build.profile.id>integration-test-emulator</build.profile.id>
                <skip.integration.tests>false</skip.integration.tests>
                <test.on.azure>false</test.on.azure>
                <test.on.emulator>true</test.on.emulator>
            </properties>
        </profile>
    </profiles>
</project>
