<?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.plugins</groupId>
        <artifactId>atlassian-plugins-parent</artifactId>
        <version>9.1.3</version>
    </parent>

    <artifactId>atlassian-plugins-osgi-spring-extender</artifactId>
    <packaging>bundle</packaging>

    <name>Atlassian Plugins - Spring DM extender repackaged bundle</name>
    <description>
        Extends Spring DM extender to integrate with plugin event system. To be replaced when Felix supports fragments.
    </description>

    <properties>
        <sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/../${jacoco.report.file}</sonar.coverage.jacoco.xmlReportPaths>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.eclipse.gemini.blueprint</groupId>
            <artifactId>gemini-blueprint-extender</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi-events</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.framework</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- test dependencies -->
        <dependency>
            <groupId>jakarta.annotation</groupId>
            <artifactId>jakarta.annotation-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Fragment-Host>org.eclipse.gemini.blueprint.extender</Fragment-Host>
                        <Bundle-SymbolicName>com.atlassian.plugin.osgi.spring</Bundle-SymbolicName>
                        <!--
                            We want bnd to automatically compute our imports, but we don't want any versions. The reason
                            is that this is a fragment bundle, and if we have mismatched attributes with our host, then
                            we can't attach (according to the OSGi) spec. Although Felix doesn't currently enforce this,
                            let's do the best we can. For forward evolution, we do it for all packages, since our host
                            might change it's requirements also.

                            See https://bitbucket.org/atlassian/atlassian-plugins/pull-request/106/diff#comment-3854363
                        -->
                        <Import-Package>
                            *;version=!
                        </Import-Package>
                        <Export-Package>
                            com.atlassian.plugin.osgi.spring.external,
                            <!-- Backwards compatibility shim for SpringDM -->
                            org.springframework.osgi.context
                        </Export-Package>
                        <Private-Package>com.atlassian.plugin.osgi.spring,org.springframework.osgi.atlassian</Private-Package>
                        <Embed-Dependency>*;scope=compile|runtime;inline=false;artifactId=!clover</Embed-Dependency>
                        <Include-Resource>{maven-resources}, META-INF/LICENSE.txt=../LICENSE.txt</Include-Resource>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>