<?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>plugins</artifactId>
        <groupId>com.atlassian.bitbucket.search</groupId>
        <version>4.0.0</version>
    </parent>

    <artifactId>func-test</artifactId>
    <name>Bitbucket Search - Func Tests</name>
    <packaging>atlassian-plugin</packaging>

    <properties>
        <license.scope>test</license.scope>
        <atlassian.dev.mode>false</atlassian.dev.mode>
        <!-- Give func tests Stash instances more time to get the AO models registered. Slow or memory-constrained
             VMs can cause AO to give up too soon -->
        <activeobjects.servicefactory.config.timeout>60000</activeobjects.servicefactory.config.timeout>
        <stash.startup.timeout>300000</stash.startup.timeout>
        <stash.dev.init.baseurl.with.machine.host>false</stash.dev.init.baseurl.with.machine.host>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-it-common</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-page-objects</artifactId>
        </dependency>

        <dependency>
            <groupId>com.atlassian.bitbucket.search</groupId>
            <artifactId>test-util</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jgit</groupId>
            <artifactId>org.eclipse.jgit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <!-- There are no unit tests below this module, only integration tests. Surefire is used to run
                         the unit tests, and Failsafe is used to run the integration tests. So we can fully disable
                         the Surefire plugin below here; it's not necessary. -->
                    <excludes>
                        <exclude>it/**/*.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <configuration>
                    <skipITs>${skipIntegrationTests}</skipITs>
                    <skipTests>${skipIntegrationTests}</skipTests>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>bitbucket-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <skipITs>${skipIntegrationTests}</skipITs>
                    <skipTests>${skipIntegrationTests}</skipTests>
                    <products>
                        <product>
                            <id>bitbucket</id>
                            <version>${bitbucket.version}</version>
                            <dataVersion>${bitbucket.version}</dataVersion>
                            <httpPort>7990</httpPort>
                            <systemPropertyVariables>
                                <file.encoding>UTF-8</file.encoding>
                                <activeobjects.servicefactory.config.timeout>${activeobjects.servicefactory.config.timeout}</activeobjects.servicefactory.config.timeout>
                                <stash.dev.init.baseurl.with.machine.host>${stash.dev.init.baseurl.with.machine.host}</stash.dev.init.baseurl.with.machine.host>
                            </systemPropertyVariables>
                            <startupTimeout>${stash.startup.timeout}</startupTimeout>
                            <pluginArtifacts>
                                <pluginArtifact>
                                    <groupId>com.atlassian.bitbucket.search</groupId>
                                    <artifactId>embedded-elasticsearch-plugin</artifactId>
                                    <version>${project.version}</version>
                                </pluginArtifact>
                                <pluginArtifact>
                                    <groupId>com.atlassian.bitbucket.search</groupId>
                                    <artifactId>bitbucket-search-common</artifactId>
                                    <version>${project.version}</version>
                                </pluginArtifact>
                                <pluginArtifact>
                                    <groupId>com.atlassian.bitbucket.search</groupId>
                                    <artifactId>bitbucket-search-query</artifactId>
                                    <version>${project.version}</version>
                                </pluginArtifact>
                                <pluginArtifact>
                                    <groupId>com.atlassian.bitbucket.search</groupId>
                                    <artifactId>bitbucket-search-index</artifactId>
                                    <version>${project.version}</version>
                                </pluginArtifact>
                            </pluginArtifacts>
                        </product>
                    </products>
                    <systemPropertyVariables>
                        <cargo.servlet.uriencoding>UTF-8</cargo.servlet.uriencoding>
                        <stash.spring.profiles>dev</stash.spring.profiles>
                        <atlassian.dev.mode>false</atlassian.dev.mode>
                        <file.encoding>UTF-8</file.encoding>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
