<?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>
        <groupId>com.atlassian.pom</groupId>
        <artifactId>closedsource-pom</artifactId>
        <version>5.0.9</version>
    </parent>

    <groupId>com.atlassian.confluence.plugins.search</groupId>
    <artifactId>confluence-search-plugin-parent</artifactId>
    <version>3.1.1</version>
    <packaging>pom</packaging>

    <name>Confluence Search Plugin Parent</name>
    <description>This is the Confluence Search Plugin for Atlassian Confluence.</description>
    <organization>
        <name>Atlassian</name>
        <url>http://www.atlassian.com/</url>
    </organization>

    <modules>
        <module>confluence-search</module>
        <module>confluence-search-test-support</module>
        <module>integration-tests</module>
    </modules>

    <scm>
        <connection>scm:git:ssh://git@stash.atlassian.com:7997/CONFSERVER/confluence-search.git</connection>
        <developerConnection>scm:git:ssh://git@stash.atlassian.com:7997/CONFSERVER/confluence-search.git</developerConnection>
        <url>https://stash.atlassian.com/projects/CONFSERVER/repos/confluence-search</url>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <confluence.version>6.5.1</confluence.version>
        <confluence.data.version>${confluence.version}</confluence.data.version>
        <amps.version>6.3.11</amps.version>
        <jvm.args.custom /> <!-- Allows to specify custom arguments in build scripts -->
        <jvm.args.xmx>1024m</jvm.args.xmx>
        <jvmArgs>-Xmx${jvm.args.xmx} ${jvm.args.custom}</jvmArgs>
        <xvfb.enable>false</xvfb.enable>
        <xvfb.display>:0</xvfb.display>
        <http.port>1990</http.port>
        <http.confluence.port>${http.port}</http.confluence.port>
        <context.confluence.path>confluence</context.confluence.path>
        <baseurl.confluence>http://localhost:${http.confluence.port}/${context.confluence.path}</baseurl.confluence>
        <enableDevToolbox>false</enableDevToolbox>
        <enableFastdev>false</enableFastdev>
        <enablePde>false</enablePde>
        <atlassian.dev.mode>false</atlassian.dev.mode>
        <compressResources>false</compressResources>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.atlassian.confluence</groupId>
                <artifactId>confluence-plugins-platform-pom</artifactId>
                <version>${confluence.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.confluence</groupId>
                <artifactId>atlassian-confluence-pageobjects</artifactId>
                <version>${confluence.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.atlassian.bundles</groupId>
                        <artifactId>google-collections</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.4</version>
                    <executions>
                        <execution>
                            <id>testjar</id>
                            <goals>
                                <goal>test-jar</goal>
                            </goals>
                            <configuration>
                                <skip>false</skip>
                                <forceCreation>true</forceCreation>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.2.2</version>
                    <configuration>
                        <!-- When using atlassian-public-pom as parent POM we need this configuration to skip tests, -->
                        <!-- as command line arguments are ignored. -->
                        <arguments>-Prelease -DskipTests</arguments>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.4.3</version>
                    <configuration>
                        <!-- Ignoring integration tests on test phase so they just run in integration-test phase.-->
                        <!-- This configuration is necessary when using AMPS together with a parent POM.-->
                        <excludes>
                            <exclude>it/**</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>maven-confluence-plugin</artifactId>
                    <version>${amps.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <jvmArgs>${jvmArgs}</jvmArgs>
                        <productVersion>${confluence.version}</productVersion>
                        <productDataVersion>${confluence.data.version}</productDataVersion>
                        <allowGoogleTracking>${enableDevToolbox}</allowGoogleTracking>
                        <skipAllPrompts>true</skipAllPrompts>
                        <enableDevToolbox>${enableDevToolbox}</enableDevToolbox>
                        <enableFastdev>${enableFastdev}</enableFastdev>
                        <enablePde>${enablePde}</enablePde>
                        <extractDependencies>false</extractDependencies>
                        <extractTestDependencies>false</extractTestDependencies>
                        <compressResources>${compressResources}</compressResources>
                        <server>localhost</server>
                        <pluginArtifacts>
                            <pluginArtifact>
                                <groupId>com.atlassian.confluence.plugins.search</groupId>
                                <artifactId>confluence-search</artifactId>
                                <version>${project.version}</version>
                            </pluginArtifact>
                        </pluginArtifacts>
                        <systemPropertyVariables>
                            <!-- This sets a system property required by the Functest RPC plugin to run in this environment -->
                            <confluence.version>${confluence.version}</confluence.version>
                            <xvfb.enable>${xvfb.enable}</xvfb.enable>
                            <xvfb.display>${xvfb.display}</xvfb.display>
                            <http.port>${http.confluence.port}</http.port>
                            <baseurl.confluence>${baseurl.confluence}</baseurl.confluence>
                            <context.path>${context.confluence.path}</context.path>
                            <atlassian.dev.mode>${atlassian.dev.mode}</atlassian.dev.mode>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <!-- Profile for Karma unit testing. Skips all other tests -->
            <id>karma</id>
           <build>
                <plugins>
                    <!-- skip ITs -->
                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>maven-confluence-plugin</artifactId>
                        <version>${amps.version}</version>
                        <configuration>
                            <skipITs>true</skipITs>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <properties>
                <!-- Skips unit tests -->
                <maven.test.skip>true</maven.test.skip>
            </properties>
    </profile>
</profiles>
</project>
