<?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">
    <parent>
        <artifactId>atlassian-crowd</artifactId>
        <groupId>com.atlassian.crowd</groupId>
        <version>3.0.0-m07</version>
        <relativePath>../..</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>crowd-functest-plugin</artifactId>

    <packaging>bundle</packaging>

    <dependencies>
        <!-- spring scanner deps -->
        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-annotation</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-runtime</artifactId>
            <scope>runtime</scope>
        </dependency>

        <!-- Test deps -->
        <dependency>
            <groupId>com.atlassian.functest</groupId>
            <artifactId>functest-plugin</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- crowd deps -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.crowd</groupId>
            <artifactId>crowd-core</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <!-- include any compile or runtime scoped dependent jars, and their transitives -->
                        <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
                        <Embed-Transitive>true</Embed-Transitive>
                        <Embed-Directory>META-INF/lib</Embed-Directory>

                        <!-- append the above dependent jars to the classpath -->
                        <Bundle-ClassPath>.,{maven-dependencies}</Bundle-ClassPath>

                        <!-- include all generated content in target, not just resources -->
                        <Include-Resource>
                            target/classes,
                            {maven-resources}
                        </Include-Resource>

                        <!-- default to empty import and export package declarations -->
                        <Import-Package>
                            <!-- spring-scanner alternate dependencies for Spring-DM / Gemini Blueprints -->
                            org.springframework.osgi.*;resolution:="optional",
                            org.eclipse.gemini.blueprint.*;resolution:="optional",

                            <!-- spring-scanner needed for wiring HostContainer into a @ModuleType -->
                            com.atlassian.plugin.osgi.bridge.external,

                            <!-- FP-23 test that missing osgi package in non-used testgroup does not break tests -->
                            com.atlassian.functest.web.util;resolution:=optional,

                            *
                        </Import-Package>
                        <Export-Package />

                        <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
                        <Atlassian-Plugin-Key>${project.groupId}.${project.artifactId}</Atlassian-Plugin-Key>
                        <Spring-Context>*</Spring-Context>
                    </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>
                    <verbose>false</verbose>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>