<?xml version="1.0"?>
<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.tenancy</groupId>
    <artifactId>atlassian-tenancy</artifactId>
      <version>2.0.0</version>
  </parent>

  <artifactId>atlassian-tenancy-compatibility-plugin</artifactId>
  <name>Atlassian Tenancy Compatibility Plugin</name>
  <description>Provides a shim of the Tenancy API so tenant-aware plugins can be deployed in non-tenant-aware containers.</description>
  <packaging>bundle</packaging>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <dependencies>
      <dependency>
          <groupId>com.atlassian.tenancy</groupId>
          <artifactId>atlassian-tenancy-api</artifactId>
          <version>${project.version}</version>
      </dependency>
      <dependency>
          <groupId>org.osgi</groupId>
          <artifactId>org.osgi.core</artifactId>
          <version>4.1.0</version>
          <scope>provided</scope>
      </dependency>
  </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Private-Package>com.atlassian.tenancy.compatibility</Private-Package>
                        <Import-Package>
                            com.atlassian.tenancy.api,
                            com.atlassian.tenancy.api.event,
                            org.osgi.framework,
                            *;resolution:=optional
                        </Import-Package>
                        <Export-Package>
                            com.atlassian.tenancy.api,
                            com.atlassian.tenancy.api.event,
                        </Export-Package>
                        <Bundle-Activator>com.atlassian.tenancy.compatibility.PluginActivator</Bundle-Activator>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <id>attach-bundle-artifact</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>${project.build.directory}/${project.build.finalName}.jar</file>
                                    <type>jar</type>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
