<?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/maven-v4_0_0.xsd">

    <parent>
        <groupId>com.atlassian.pom</groupId>
        <artifactId>closedsource-pom</artifactId>
        <version>3.0.98</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <groupId>com.atlassian.confluence.plugins</groupId>
    <artifactId>confluence-onboarding</artifactId>
    <version>2.0.16</version>

    <name>Confluence Onboarding</name>
    <description>This is the com.atlassian.confluence.plugins:onboarding plugin for Atlassian Confluence.</description>
    <packaging>atlassian-plugin</packaging>

    <organization>
        <name>Atlassian</name>
        <url>http://www.atlassian.com/</url>
    </organization>

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

    <dependencies>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence</artifactId>
            <version>${confluence.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence.plugins</groupId>
            <artifactId>confluence-notifications-api</artifactId>
            <version>${confluence-notifications.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence.plugins</groupId>
            <artifactId>confluence-content-notifications-plugin</artifactId>
            <version>${confluence-notifications.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugin.notifications</groupId>
            <artifactId>notifications-api</artifactId>
            <version>${notifications.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-common</artifactId>
            <version>2.6.7</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
            <version>1.1.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.2.2-atlassian-1</version>
            <scope>provided</scope>
        </dependency>

        <!-- WIRED TEST RUNNER DEPENDENCIES -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian</groupId>
            <artifactId>atlassian-test-categories</artifactId>
            <version>${atlassian-test-categories.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- Stateless Test Runner -->
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence-stateless-test-runner</artifactId>
            <version>${confluence-stateless-test-runner.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence-rest-client</artifactId>
            <version>${confluence.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence-webdriver-pageobjects</artifactId>
            <version>${confluence.webdriver.pageobjects.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- Confluence runs on guava 11 while webdriver-pageobjects need 13 -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>13.0.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence.plugins</groupId>
            <artifactId>confluence-functestrpc-plugin</artifactId>
            <version>${confluence.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence.plugins</groupId>
            <artifactId>confluence-functest-rest-plugin</artifactId>
            <version>${confluence.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence.plugins</groupId>
            <artifactId>confluence-scriptsfinished-plugin</artifactId>
            <version>${confluence.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence.plugins</groupId>
            <artifactId>confluence-create-content-plugin</artifactId>
            <version>5.0.9</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence.plugins</groupId>
            <artifactId>dialog-wizard</artifactId>
            <version>0.6</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.0.1</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-confluence-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <containerId>tomcat7x</containerId>
                    <extractDependencies>false</extractDependencies>
                    <skipManifestValidation>true</skipManifestValidation>

                    <productVersion>${confluence.version}</productVersion>
                    <productDataVersion>${confluence.data.version}</productDataVersion>
                    <systemPropertyVariables>
                        <confluence.version>${confluence.version}</confluence.version> <!-- system property required by Functest RPC plugin -->
                        <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>
                    </systemPropertyVariables>
                    <pluginArtifacts>
                        <!-- Needed by the Stateless Test Runner -->
                        <pluginArtifact>
                            <groupId>com.atlassian.confluence.plugins</groupId>
                            <artifactId>confluence-functestrpc-plugin</artifactId>
                            <version>${confluence.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.confluence.plugins</groupId>
                            <artifactId>confluence-functest-rest-plugin</artifactId>
                            <version>${confluence.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.confluence.plugins</groupId>
                            <artifactId>confluence-scriptsfinished-plugin</artifactId>
                            <version>${confluence.version}</version>
                        </pluginArtifact>
                    </pluginArtifacts>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.16</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>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                        <configuration>
                            <forceCreation>true</forceCreation>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.2.2</version>
                <configuration>
                    <arguments>-Prelease -DskipTests</arguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <!-- Profile for Karma unit testing. Skips all other tests -->
            <id>karma</id>
            <dependencies>
                <!-- Only ekarmxists for qunit -->
                <dependency>
                    <groupId>com.atlassian.soy</groupId>
                    <artifactId>soy-template-plugin</artifactId>
                    <version>${soy.template.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>com.atlassian.plugins</groupId>
                    <artifactId>jquery</artifactId>
                    <version>${jquery.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>com.atlassian.aui</groupId>
                    <artifactId>auiplugin</artifactId>
                    <version>${aui.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>com.atlassian.aui</groupId>
                    <artifactId>aui-soy</artifactId>
                    <version>${aui.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <!-- Install npm modules first -->
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>1.2.1</version>
                        <executions>
                            <execution>
                                <id>install-npm-modules</id>
                                <phase>generate-test-sources</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <executable>npm</executable>
                            <arguments>
                                <argument>install</argument>
                            </arguments>
                        </configuration>
                    </plugin>
                    <plugin>
                        <!-- Extract AUI for use in tests -->
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>extract-qunit-dependencies</id>
                                <phase>generate-test-resources</phase>
                                <goals>
                                    <goal>unpack-dependencies</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.build.directory}/qunit/dependencies</outputDirectory>
                                    <includeGroupIds>com.atlassian.aui,com.atlassian.soy,com.atlassian.plugins</includeGroupIds>
                                    <includeArtifactIds>auiplugin,soy-template-plugin,jquery</includeArtifactIds>
                                    <includes>**/i18n/aui.properties</includes>
                                    <includes>**/*.js,**/*.soy,**/*.properties</includes>
                                    <!--<excludes>**/*-min.soy, **/*-min.js</excludes>-->
                                </configuration>
                            </execution>
                        </executions>
                        <!--<configuration>-->
                            <!--<useJvmChmod>true</useJvmChmod>-->
                        <!--</configuration>-->
                    </plugin>
                    <plugin>
                        <!-- Run the karma tests during test phase -->
                        <groupId>com.kelveden</groupId>
                        <artifactId>maven-karma-plugin</artifactId>
                        <version>1.8</version>
                        <executions>
                            <execution>
                                <id>run-karma-tests</id>
                                <goals>
                                    <goal>start</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <!-- Use Phantom for the automated build because I couldn't get Chrome to work on a Bamboo agent -->
                            <browsers>PhantomJS</browsers>
                            <karmaExecutable>node_modules/karma/bin/karma</karmaExecutable>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>soy-to-js-maven-plugin</artifactId>
                        <version>1.8</version>
                        <dependencies>
                            <dependency>
                                <groupId>com.atlassian.confluence</groupId>
                                <artifactId>confluence-karma-testrunner-support</artifactId>
                                <version>0.0.6</version>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <id>generate-aui-js-from-soy</id>
                                <phase>generate-test-resources</phase>
                                <goals>
                                    <goal>compile</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.build.directory}/qunit/soy</outputDirectory>
                                    <resources>
                                        <directory>${project.build.directory}/qunit/dependencies/soy/</directory>
                                        <includes>
                                            <include>**/*.soy</include>
                                        </includes>
                                    </resources>
                                    <propertiesFile>${project.build.directory}/qunit/dependencies/i18n/aui.properties</propertiesFile>
                                </configuration>
                            </execution>
                            <execution>
                                <id>generate-js-from-soy</id>
                                <phase>generate-test-resources</phase>
                                <goals>
                                    <goal>compile</goal>
                                </goals>
                                <configuration>
                                    <module>com.atlassian.confluence.test.support.karma.CustomFunctionTransformModule</module>
                                    <outputDirectory>${project.build.directory}/qunit/soy</outputDirectory>
                                    <resources>
                                        <directory>${project.basedir}/src/main/resources/</directory>
                                        <includes>
                                            <include>**/*.soy</include>
                                        </includes>
                                        <excludes>
                                            <exclude>notifications/*.soy</exclude>
                                        </excludes>
                                    </resources>
                                    <propertiesFile>${project.basedir}/src/main/resources/onboarding.properties</propertiesFile>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- skip ITs -->
                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>maven-confluence-plugin</artifactId>
                        <configuration>
                            <skipITs>true</skipITs>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <skipTests>true</skipTests>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <properties>
                <!-- Skips unit tests -->
                <maven.test.unit.skip>true</maven.test.unit.skip>
                <maven.test.skip>true</maven.test.skip>
            </properties>
        </profile>
    </profiles>

    <properties>
        <confluence.version>5.9.7</confluence.version>
        <confluence.data.version>${confluence.version}</confluence.data.version>
        <confluence.webdriver.pageobjects.version>2.16.4</confluence.webdriver.pageobjects.version>
        <confluence-notifications.version>6.3.0</confluence-notifications.version>
        <notifications.version>3.2.14</notifications.version>
        <aui.version>5.8.7</aui.version>
        <jquery.version>1.7.2</jquery.version>
        <soy.template.version>2.7.1</soy.template.version>
        <xvfb.enable>true</xvfb.enable>
        <xvfb.display>:0</xvfb.display>
        <http.port>8080</http.port>
        <http.confluence.port>${http.port}</http.confluence.port>
        <context.path>/confluence</context.path>
        <amps.version>5.1.12</amps.version>
        <plugin.testrunner.version>1.2.0</plugin.testrunner.version>
        <context.confluence.path>confluence</context.confluence.path>
        <baseurl.confluence>http://localhost:${http.confluence.port}/${context.confluence.path}</baseurl.confluence>
        <atlassian.selenium.version>2.2.0</atlassian.selenium.version>
        <selenium.version>2.41.0</selenium.version>
        <mockito.version>1.10.19</mockito.version>
        <confluence-stateless-test-runner.version>1.0.23</confluence-stateless-test-runner.version>
        <atlassian-test-categories.version>0.5</atlassian-test-categories.version>
        <junit.version>4.11</junit.version>
    </properties>
</project>
