<?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>
        <groupId>com.atlassian.plugins</groupId>
        <artifactId>atlassian-dark-features-parent</artifactId>
        <version>2.0.0</version>
    </parent>

    <artifactId>atlassian-dark-features-rest-plugin</artifactId>
    <name>Atlassian Dark Features REST interface</name>
    <description>Provides access to the dark features via a REST interface.</description>
    <packaging>atlassian-plugin</packaging>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.annotations</groupId>
            <artifactId>atlassian-annotations</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-v2-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.ws.rs</groupId>
            <artifactId>jakarta.ws.rs-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.inject</groupId>
            <artifactId>jakarta.inject-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-it-common</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-common</artifactId>
            <scope>test</scope>
            <version>2.42</version>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <scope>test</scope>
            <version>5.2.0</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <includes>
                        <include>**/Test*.java</include>
                        <include>**/*Test.java</include>
                    </includes>
                    <!-- Do not run integration / functional tests -->
                    <excludes>
                        <exclude>it/**/*</exclude>
                        <exclude>**/*$*</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>amps-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Import-Package>
                            javax.ws.rs;version="[2.0.0,3.0.0)",
                            javax.ws.rs.core;version="[2.0.0,3.0.0)",
                            *
                        </Import-Package>
                    </instructions>
                    <parallel>${amps.parallel}</parallel>
                    <enableDevToolbox>${devtools.enable}</enableDevToolbox>
                    <enableQuickReload>${devtools.enable}</enableQuickReload>
                    <enablePde>${devtools.enable}</enablePde>
                    <extractDependencies>false</extractDependencies>
                    <systemPropertyVariables>
                        <xvfb.enable>${xvfb.enable}</xvfb.enable>
                        <atlassian.darkfeature.enabled.dark.feature>true</atlassian.darkfeature.enabled.dark.feature>
                        <atlassian.darkfeature.disabled.dark.feature>false</atlassian.darkfeature.disabled.dark.feature>
                    </systemPropertyVariables>
                    <products>
                        <product>
                            <id>bitbucket</id>
                            <version>${bitbucket.version}</version>
                            <log4jProperties>src/test/resources/log4j.properties</log4jProperties>
                            <output>${project.build.directory}/bitbucket.log</output>
                        </product>
                        <product>
                            <id>confluence</id>
                            <version>${confluence.version}</version>
                            <log4jProperties>src/test/resources/log4j.properties</log4jProperties>
                            <output>${project.build.directory}/confluence.log</output>
                        </product>
                        <product>
                            <id>crowd</id>
                            <version>${crowd.version}</version>
                            <log4jProperties>src/test/resources/log4j.properties</log4jProperties>
                            <output>${project.build.directory}/crowd.log</output>
                        </product>
                        <product>
                            <id>fecru</id>
                            <version>${fecru.version}</version>
                            <output>${project.build.directory}/fecru.log</output>
                        </product>
                        <product>
                            <id>bamboo</id>
                            <version>${bamboo.version}</version>
                            <output>${project.build.directory}/bamboo.log</output>
                        </product>
                        <product>
                            <id>refapp</id>
                            <version>${refapp.version}</version>
                            <log4jProperties>src/test/resources/log4j.properties</log4jProperties>
                            <output>${project.build.directory}/refapp.log</output>
                        </product>
                    </products>
                    <testGroups>
                        <testGroup>
                            <id>refapp</id>
                            <productIds>
                                <productId>refapp</productId>
                            </productIds>
                            <includes>
                                <include>it/**/refapp/*.java</include>
                            </includes>
                        </testGroup>
                        <testGroup>
                            <id>bitbucket</id>
                            <productIds>
                                <productId>bitbucket</productId>
                            </productIds>
                            <includes>
                                <include>it/**/bitbucket/*.java</include>
                            </includes>
                        </testGroup>
                    </testGroups>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>it</id>
            <activation>
                <property>
                    <!--if test group is supplied, it means we want tests!-->
                    <name>testGroup</name>
                </property>
            </activation>
            <properties>
                <skipITs>false</skipITs>
            </properties>
        </profile>
    </profiles>
    <properties>
        <skipITs>true</skipITs>
    </properties>
</project>
