<?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">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <artifactId>atlassian-project-creation</artifactId>
        <groupId>com.atlassian.plugins</groupId>
        <version>1.2.5</version>
    </parent>

    <groupId>com.atlassian.plugins</groupId>
    <artifactId>jira-project-creation</artifactId>

    <name>Project Creation Plugin SPI for JIRA</name>
    <description>This is the com.atlassian.plugins:jira-project-creation plugin for Atlassian JIRA.</description>
    <packaging>atlassian-plugin</packaging>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-project-creation-spi</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
        </dependency>

        <!-- test related components -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi-testrunner</artifactId>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-project-creation-spi</artifactId>
            <classifier>acceptance-tests</classifier>
            <!-- if you intend to extend these tests intend of running them directly, use compile scope. -->
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.framework</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>jira-project-creation-test-utils-plugin</artifactId>
        </dependency>

        <dependency>
            <groupId>com.atlassian.qunit</groupId>
            <artifactId>atlassian-qunit-plugin</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.qunit</groupId>
            <artifactId>atlassian-qunit-plugin-util</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.selenium</groupId>
            <artifactId>atlassian-pageobjects-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.selenium</groupId>
            <artifactId>atlassian-webdriver-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.selenium</groupId>
            <artifactId>atlassian-selenium</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.selenium</groupId>
            <artifactId>atlassian-pageobjects-elements</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>atlassian-jira-pageobjects</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-nimble-func-tests</artifactId>
            <version>0.2.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.federation</groupId>
            <artifactId>federated-api-ctk-test-utilities</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-project-creation-plugin</artifactId>
        </dependency>
        <!--end test related components -->
    </dependencies>

    <build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <includes>
                    <include>localtest.properties</include>
                    <include>seleniumtest.properties</include>
                </includes>
                <filtering>true</filtering>
            </testResource>
            <testResource>
                <directory>src/test/resources</directory>
                <excludes>
                    <exclude>localtest.properties</exclude>
                    <exclude>seleniumtest.properties</exclude>
                </excludes>
                <filtering>false</filtering>
            </testResource>
            <testResource>
                <directory>src/test/xml</directory>
                <targetPath>xml</targetPath>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.15</version>
                <configuration>
                    <dependenciesToScan>
                        <dependency>com.atlassian.plugins:atlassian-project-creation-spi:acceptance-tests</dependency>
                    </dependenciesToScan>
                </configuration>
            </plugin>
            <!-- to run the tests from the acceptance-tests jar, we need to unpack them as we've excluded all test dependencies. -->
            <!-- only include **/*.xml and exclude **/*.class if your tests extend the tests from the acceptance-tests jar. -->
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack-acceptance-tests</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.atlassian.plugins</groupId>
                                    <artifactId>atlassian-project-creation-spi</artifactId>
                                    <classifier>acceptance-tests</classifier>
                                    <version>${project.version}</version>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-jira-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <productVersion>${jira.version}</productVersion>
                    <productDataVersion>${jira.version}</productDataVersion>
                    <instructions>
                        <Atlassian-Plugin-Key>com.atlassian.plugins.jira-project-creation</Atlassian-Plugin-Key>
                        <Import-Package>
                            com.atlassian.crowd.embedded.api;version="[6,8)",
                            com.atlassian.fugue;version="[1.1,3)",
                            com.atlassian.jira*;version="[6,8)",
                            com.atlassian.plugin,
                            com.atlassian.plugin.osgi.bridge.external,
                            com.atlassian.plugin.predicate,
                            com.atlassian.plugins.projectcreate.spi,
                            com.google.common.base,
                            com.google.common.collect,
                            javax.annotation,
                            javax.ws.rs.core,
                            org.ofbiz.core.entity"
                        </Import-Package>
                    </instructions>
                    <pluginArtifacts>
                        <pluginArtifact>
                            <groupId>com.atlassian.plugins</groupId>
                            <artifactId>atlassian-project-creation-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.qunit</groupId>
                            <artifactId>atlassian-qunit-plugin</artifactId>
                            <version>${atlassian.qunit.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.jira</groupId>
                            <artifactId>jira-func-test-plugin</artifactId>
                            <version>${jira.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.jira.tests</groupId>
                            <artifactId>jira-testkit-plugin</artifactId>
                            <version>${jira.testkit.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.plugins</groupId>
                            <artifactId>atlassian-awareness-capability</artifactId>
                            <version>${awareness.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.plugins</groupId>
                            <artifactId>jira-project-creation-test-utils-plugin</artifactId>
                            <version>${project.version}</version>
                        </pluginArtifact>
                    </pluginArtifacts>
                    <jvmArgs>-Datlassian.darkfeature.rotp.project.create=true</jvmArgs>
                    <jvmDebugPort>5006</jvmDebugPort>
                    <output>${project.build.directory}/jira.log</output>
                    <parallel>true</parallel>
                    <parallel>${amps.parallel}</parallel>
                    <systemPropertyVariables>
                        <jira.websudo.is.disabled>true</jira.websudo.is.disabled>
                        <xvfb.enable>true</xvfb.enable>
                    </systemPropertyVariables>

                    <!-- so that yo don't end up with a huge tests.jar -->
                    <excludeAllTestDependencies>true</excludeAllTestDependencies>

                    <!-- so that the atlassian-plugin.xml defined in the spi acceptance-tests jar can be used. -->
                    <buildTestPlugin>true</buildTestPlugin>

                    <testGroups>
                        <testGroup>
                            <id>jira-and-ctk</id>
                            <productIds>
                                <!-- The order of these matters (!!!) -->
                                <productId>jira</productId>
                                <productId>ctk-server</productId>
                            </productIds>
                            <systemProperties>
                                <testedProductClass>com.atlassian.jira.pageobjects.JiraTestedProduct</testedProductClass>
                                <jira.port>2990</jira.port>
                                <jira.context>/jira</jira.context>
                            </systemProperties>
                            <includes>
                                <include>it/**/jira/**/webdriver/**/*Test.java</include>
                            </includes>
                        </testGroup>
                        <testGroup>
                            <id>jira</id>
                            <productIds>
                                <productId>jira-alt</productId>
                            </productIds>
                            <systemProperties>
                                <jira.port>2991</jira.port>
                                <testedProductClass>com.atlassian.jira.pageobjects.JiraTestedProduct</testedProductClass>
                            </systemProperties>
                            <includes>
                                <include>it/com/**/spi/*Test.java</include>
                            </includes>
                        </testGroup>
                    </testGroups>
                    <products>
                        <product>
                            <id>jira</id>
                            <version>${jira.version}</version>
                            <httpPort>2990</httpPort>
                            <jvmDebugPort>5005</jvmDebugPort>
                        </product>
                        <product>
                            <id>jira</id>
                            <instanceId>jira-alt</instanceId>
                            <version>${jira.version}</version>
                            <httpPort>2991</httpPort>
                            <jvmDebugPort>5006</jvmDebugPort>
                        </product>
                        <product>
                            <id>ctk-server</id>
                            <version>${ctk.version}</version>
                            <output>${project.build.directory}/ctk-server.log</output>
                            <jvmDebugPort>5007</jvmDebugPort>
                        </product>
                    </products>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-amps-dispatcher-plugin</artifactId>
                <version>${amps.version}</version>
            </plugin>
        </plugins>
    </build>

</project>
