<?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.querylang</groupId>
        <artifactId>confluence-cql-plugin-parent</artifactId>
        <version>7.0.5</version>
    </parent>

    <artifactId>confluence-cql-plugin</artifactId>
    <packaging>atlassian-plugin</packaging>

    <name>Confluence CQL plugin</name>
    <description>This is the com.atlassian.confluence.plugins:confluence-cql-plugin plugin for Atlassian Confluence.
    </description>

    <properties>
        <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>
        <atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.querylang</groupId>
            <artifactId>atlassian-query-lang</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-lang3</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.querylang</groupId>
            <artifactId>confluence-query-lang-spi</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence-java-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-module</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!--Spring-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-annotation</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- TEST DEPENDENCIES -->
        <dependency>
            <groupId>com.atlassian.querylang</groupId>
            <artifactId>confluence-cql-test-support</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence-test-support</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence-testutils</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-common</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.nekohtml</groupId>
            <artifactId>nekohtml</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.jwebunit</groupId>
            <artifactId>jwebunit-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>confluence-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <containerId>${containerId}</containerId>
                    <jvmArgs>${jvm.args}</jvmArgs>
                    <productVersion>${confluence.version}</productVersion>
                    <productDataVersion>${confluence.data.version}</productDataVersion>
                    <allowGoogleTracking>${enableDevToolbox}</allowGoogleTracking>
                    <skipAllPrompts>true</skipAllPrompts>
                    <enableDevToolbox>${enableDevToolbox}</enableDevToolbox>
                    <enablePde>${enablePde}</enablePde>
                    <extractDependencies>false</extractDependencies>
                    <extractTestDependencies>false</extractTestDependencies>
                    <compressResources>${compressResources}</compressResources>
                    <server>localhost</server>
                    <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>
                    <instructions>
                        <Atlassian-Plugin-Key>${atlassian.plugin.key}</Atlassian-Plugin-Key>
                        <Spring-Context>*</Spring-Context>
                        <Import-Package>
                            com.atlassian.plugin.osgi.bridge.external, <!-- required for AQL ModuleDescriptors -->
                            com.atlassian.plugin.module,
                            com.atlassian.confluence.*,
                            *;resolution:="optional"
                        </Import-Package>
                        <Export-Package>
                            com.atlassian.confluence.plugins.cql.spi*,
                            com.atlassian.querylang*,
                            org.antlr.v4.runtime*
                        </Export-Package>
                    </instructions>
                </configuration>
            </plugin>

            <plugin>
                <groupId>com.atlassian.plugin</groupId>
                <artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
                <version>${atlassian.spring.scanner.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>atlassian-spring-scanner</goal>
                        </goals>
                        <!-- process-classes seems to be skipped if you are using scala
                             so perhaps use prepare-package -->
                        <phase>process-classes</phase>
                    </execution>
                </executions>
                <configuration>
                    <scannedDependencies>
                        <dependency>
                            <groupId>com.atlassian.querylang</groupId>
                            <artifactId>atlassian-query-lang</artifactId>
                        </dependency>
                        <dependency>
                            <groupId>com.atlassian.querylang</groupId>
                            <artifactId>confluence-query-lang-spi</artifactId>
                        </dependency>
                    </scannedDependencies>
                    <verbose>false</verbose>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <executions>
                    <execution>
                        <id>update</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
