<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>jira-project-config-plugin-parent</artifactId>
        <!-- The version specified here is not actually the version being worked on. It is set to the minor version after the
             one being worked on to ensure that the version in development always takes precedence over our regular bugfix releases
             (created by the deployment pipeline) during plugin version resolution -->
        <version>6.3.44</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.atlassian.jira</groupId>
    <artifactId>jira-project-config-plugin</artifactId>
    <packaging>atlassian-plugin</packaging>
    <name>JIRA Project Config Plugin</name>

    <build>
        <finalName>${project.artifactId}-${project.version}</finalName>
        <resources>
            <resource>
                <directory>${min.resources}</directory>
                <filtering>false</filtering>
                <includes>
                    <include>**/*-min.js</include>
                    <include>**/*-min.css</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/atlassian-plugin.xml</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
                <excludes>
                    <exclude>**/atlassian-plugin.xml</exclude>
                </excludes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-jira-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <enableDevToolbox>false</enableDevToolbox>
                    <enableFastdev>false</enableFastdev>
                    <extractDependencies>true</extractDependencies>
                    <instructions>
                        <Atlassian-Plugin-Key>${project.groupId}.${project.artifactId}</Atlassian-Plugin-Key>
                        <Spring-Context>*</Spring-Context>
                        <Export-Package>
                            com.atlassian.jira.projectconfig.util
                        </Export-Package>
                        <Import-Package>
                            org.springframework.*,
                            org.osgi.framework.*,
                            org.w3c.dom,
                            com.atlassian.plugin.osgi.factory.*,
                            com.atlassian.jira.plugin.webfragment.conditions,
                            *;resolution:=optional
                        </Import-Package>
                    </instructions>
                    <pluginArtifacts>
                        <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>${testkit.version}</version>
                        </pluginArtifact>
                        <pluginArtifact>
                            <groupId>com.atlassian.qunit</groupId>
                            <artifactId>atlassian-qunit-plugin</artifactId>
                            <version>${atlassian.qunit.plugin.version}</version>
                        </pluginArtifact>
                    </pluginArtifacts>
                    <productVersion>${jira.version}</productVersion>
                    <productDataVersion>${jira.data.version}</productDataVersion>
                    <systemPropertyVariables>
                        <atlassian.qunit.plugin.output.path>${project.build.directory}/surefire-reports</atlassian.qunit.plugin.output.path>
                        <xvfb.enable>${xvfb.enable}</xvfb.enable>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.16</version>
                <configuration>
                    <excludes>
                        <exclude>it/**</exclude>
                    </excludes>
                    <skip>${maven.test.unit.skip}</skip>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.1</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>${build.helper.version}</version>
            </plugin>
            <plugin>
                <groupId>net.sf.alchim</groupId>
                <artifactId>yuicompressor-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>compress</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <linebreakpos>-1</linebreakpos>
                    <jswarn>false</jswarn>
                    <nomunge>true</nomunge>
                    <excludes>
                        <exclude>${min.resources}/**</exclude>
                        <exclude>**/*.xml</exclude>
                        <exclude>**/*-min*</exclude>
                        <exclude>**/*-test.js</exclude>
                        <exclude>**/*-tests.js</exclude>
                    </excludes>
                    <outputDirectory>${min.resources}</outputDirectory>
                </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>
                <groupId>com.atlassian.lesscss</groupId>
                <artifactId>lesscss-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>compile-less</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>false</filtering>
            </testResource>
            <testResource>
                <directory>src/test/xml</directory>
                <filtering>false</filtering>
                <includes>
                    <include>*.xml</include>
                </includes>
                <targetPath>xml</targetPath>
            </testResource>
        </testResources>
    </build>
    <dependencies>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api</artifactId>
            <version>${jira.compile.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-core</artifactId>
            <version>${jira.compile.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>${javax.servlet.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-tests</artifactId>
            <version>${jira.compile.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>com.atlassian.templaterenderer</groupId>
          <artifactId>atlassian-template-renderer-api</artifactId>
          <version>${template.renderer.version}</version>
          <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>${log4j.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
            <version>${jsr311.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-common</artifactId>
            <version>${rest.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- HACK: this should be pulled in by com.sun.jersey:jersey-server:jar:1.8-atlassian-6, but isn't. -->
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-core</artifactId>
            <version>${jersey.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-rest-api</artifactId>
            <version>${jira.rest.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>${spring.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira.plugins</groupId>
            <artifactId>workflow-designer-plugin</artifactId>
            <version>${jira.workflow.designer.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-annotation</artifactId>
            <version>${spring.scanner.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-processor</artifactId>
            <version>${spring.scanner.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-runtime</artifactId>
            <version>${spring.scanner.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.qunit</groupId>
            <artifactId>atlassian-qunit-plugin-util</artifactId>
            <version>${atlassian.qunit.plugin.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-project-config-pageobjects</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-webdriver-tests</artifactId>
            <version>${jira.compile.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.1</version>
            <scope>provided</scope>
        </dependency>
        <!-- This section is needed to upgrade to the latest Firefox for web-driver tests -->
        <!--<dependency>-->
            <!--<groupId>com.atlassian.selenium</groupId>-->
            <!--<artifactId>atlassian-webdriver-core</artifactId>-->
            <!--<version>${webdriver.version}</version>-->
            <!--<scope>test</scope>-->
        <!--</dependency>-->
        <!--<dependency>-->
            <!--<groupId>com.atlassian.selenium</groupId>-->
            <!--<artifactId>atlassian-selenium</artifactId>-->
            <!--<version>${webdriver.version}</version>-->
            <!--<scope>test</scope>-->
        <!--</dependency>-->
        <!-- End of firefox upgrade section -->

        <dependency>
            <groupId>com.atlassian.buildeng.hallelujah</groupId>
            <artifactId>server</artifactId>
            <version>${hallelujah.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.sun.jersey</groupId>
                    <artifactId>jersey-grizzly</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.buildeng.hallelujah</groupId>
            <artifactId>client</artifactId>
            <version>${hallelujah.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.sun.jersey</groupId>
                    <artifactId>jersey-grizzly</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
    <profiles>
        <profile>
            <id>pseudo-loc</id>
            <build>
                <resources>
                    <resource>
                        <directory>${generated.locale.dir}</directory>
                    </resource>
                </resources>
                <plugins>
                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>pseudo-loc-maven-plugin</artifactId>
                        <version>1.0</version>
                        <executions>
                            <execution>
                                <id>pseudo-loc</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>pseudo-loc</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <sourceLocale>en_UK</sourceLocale>
                            <targetLocale>en_AQ</targetLocale>
                            <pseudoLocaliseActions>
                                <pseudoLocaliseAction>
                                    <source>src/main/resources/jira-project-config-plugin.properties</source>
                                    <target>${generated.locale.dir}/jira-project-config-plugin_{loc}.properties</target>
                                </pseudoLocaliseAction>
                            </pseudoLocaliseActions>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!-- Run only the project config QUnit test suite (e.g. `mvn3 clean verify -PrunTestSuite -DtestGroups=QUnit`). -->
        <profile>
            <id>runTestSuite</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>maven-jira-plugin</artifactId>
                        <configuration>
                            <pluginArtifacts>
                                <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>${testkit.version}</version>
                                </pluginArtifact>
                                <pluginArtifact>
                                    <groupId>com.atlassian.qunit</groupId>
                                    <artifactId>atlassian-qunit-plugin</artifactId>
                                    <version>${atlassian.qunit.plugin.version}</version>
                                </pluginArtifact>
                            </pluginArtifacts>
                            <products>
                                <product>
                                    <id>jira</id>
                                    <version>${jira.version}</version>
                                    <dataVersion>${jira.data.version}</dataVersion>
                                </product>
                            </products>
                            <testGroups>
                                <testGroup>
                                    <id>QUnit</id>
                                    <includes>
                                        <include>**/it/com/atlassian/jira/projectconfig/qunit/**</include>
                                    </includes>
                                    <productIds>
                                        <productId>jira</productId>
                                    </productIds>
                                </testGroup>
                                <testGroup>
                                    <id>Func</id>
                                    <includes>
                                        <include>**/it/com/atlassian/jira/projectconfig/func/webtests/**</include>
                                    </includes>
                                    <productIds>
                                        <productId>jira</productId>
                                    </productIds>
                                </testGroup>
                                <testGroup>
                                    <id>WebDriver</id>
                                    <includes>
                                        <include>**/it/com/atlassian/jira/projectconfig/webdriver/tests/**</include>
                                    </includes>
                                    <productIds>
                                        <productId>jira</productId>
                                    </productIds>
                                </testGroup>
                            </testGroups>
                            <systemPropertyVariables>
                                <xvfb.enable>${xvfb.enable}</xvfb.enable>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>hallelujahServer</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>1.1.1</version>
                        <executions>
                            <execution>
                                <phase>test</phase>
                                <goals>
                                    <goal>java</goal>
                                </goals>
                                <configuration>
                                    <mainClass>it.com.atlassian.jira.projectconfig.hallelujah.ProjectConfigHallelujahServer</mainClass>
                                    <classpathScope>test</classpathScope>
                                    <systemProperties>
                                        <systemProperty>
                                            <key>atlassian.test.suite.package</key>
                                            <value>${atlassian.test.suite.package}</value>
                                        </systemProperty>
                                        <systemProperty>
                                            <key>atlassian.test.suite.includes</key>
                                            <value>${atlassian.test.suite.includes}</value>
                                        </systemProperty>
                                        <systemProperty>
                                            <key>atlassian.test.suite.excludes</key>
                                            <value>${atlassian.test.suite.excludes}</value>
                                        </systemProperty>
                                        <systemProperty>
                                            <key>atlassian.test.run.only.quarantined</key>
                                            <value>${atlassian.test.run.only.quarantined}</value>
                                        </systemProperty>
                                        <systemProperty>
                                            <key>atlassian.test.target.dir</key>
                                            <value>${atlassian.test.target.dir}</value>
                                        </systemProperty>
                                        <systemProperty>
                                            <key>jira.functest.single.testclass</key>
                                            <value>${jira.functest.single.testclass}</value>
                                        </systemProperty>
                                        <systemProperty>
                                            <key>jira.hallelujah.queueId</key>
                                            <value>${jira.hallelujah.queueId}</value>
                                        </systemProperty>
                                        <systemProperty>
                                            <key>jira.qunit.testoutput.location</key>
                                            <value>${project.build.directory}/surefire-reports</value>
                                        </systemProperty>
                                    </systemProperties>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <properties>
                <skipTests>true</skipTests>
            </properties>
        </profile>
        <profile>
            <id>hallelujahClient</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>maven-jira-plugin</artifactId>
                        <configuration>
                            <products>
                                <product>
                                    <id>jira</id>
                                    <version>${jira.version}</version>
                                    <dataVersion>${jira.data.version}</dataVersion>
                                </product>
                            </products>
                            <testGroups>
                                <testGroup>
                                    <id>hallelujahClient</id>
                                    <includes>
                                        <include>**/ProjectConfigHallelujahClient.java</include>
                                    </includes>
                                    <productIds>
                                        <productId>jira</productId>
                                    </productIds>
                                </testGroup>
                            </testGroups>
                            <systemProperties>
                                <property>
                                    <name>atlassian.test.target.dir</name>
                                    <value>${atlassian.test.target.dir}</value>
                                </property>
                            </systemProperties>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <properties>
                <testGroups>hallelujahClient</testGroups>
            </properties>
        </profile>
        <profile>
            <id>skipTests</id>
            <properties>
                <maven.test.unit.skip>true</maven.test.unit.skip>
                <skipTests>true</skipTests>
            </properties>
        </profile>
        <profile>
            <id>ondemand-acceptance-tests</id>
            <properties>
                <maven.test.unit.skip>true</maven.test.unit.skip>
                <skipTests>true</skipTests>
                <od.testing.configuration>
                    use-maven,3
                </od.testing.configuration>
            </properties>
        </profile>
    </profiles>
    <properties>
        <generated.locale.dir>${project.build.directory}/generated-sources/pseudo-loc</generated.locale.dir>
        <min.resources>${project.build.directory}/generated-resources/min</min.resources>
    </properties>
</project>
