<?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>project</artifactId>
    <groupId>io.hawt</groupId>
    <version>1.4.7</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>hawtio-local-jvm-mbean</artifactId>
  <packaging>bundle</packaging>
  <name>${project.artifactId}</name>
  <description>hawtio :: ${project.artifactId}</description>

  <properties>
    <fuse.osgi.export>
      io.hawt.jvm.local
    </fuse.osgi.export>
    <fuse.osgi.import>
      io.hawt.jvm.local,
      *;resolution:=optional
    </fuse.osgi.import>
  </properties>


  <dependencies>

    <dependency>
      <groupId>com.sun</groupId>
      <artifactId>tools</artifactId>
      <version>1.6</version>
      <scope>system</scope>
      <systemPath>${toolsjar}</systemPath>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j-version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.jolokia</groupId>
      <artifactId>jolokia-jvm</artifactId>
      <version>${jolokia-version}</version>
      <classifier>agent</classifier>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit-version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>${slf4j-version}</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>${maven-bundle-plugin-version}</version>
        <extensions>true</extensions>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <supportedProjectTypes>
            <supportedProjectType>jar</supportedProjectType>
            <supportedProjectType>bundle</supportedProjectType>
            <supportedProjectType>war</supportedProjectType>
          </supportedProjectTypes>
          <instructions>

            <Export-Package>${fuse.osgi.export}</Export-Package>
            <Import-Package>${fuse.osgi.import}</Import-Package>
            <DynamicImport-Package>*</DynamicImport-Package>

            <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
            <Embed-Transitive>true</Embed-Transitive>

            <Bundle-Name>${project.description}</Bundle-Name>
            <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>

            <Implementation-Title>HawtIO</Implementation-Title>
            <Implementation-Version>${project.version}</Implementation-Version>

            <DynamicImport-Package>*</DynamicImport-Package>
          </instructions>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!-- TODO rework tests to also run properly on Windows -->
    <profile>
      <id>
        SkipTestsOnWindows
      </id>
      <activation>
        <os>
          <family>Windows</family>
        </os>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <skipTests>true</skipTests>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
