<?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/maven-v4_0_0.xsd">
  <parent>
    <groupId>io.hawt</groupId>
    <artifactId>project</artifactId>
    <version>2.3.0</version>
    <relativePath>../..</relativePath>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <artifactId>hawtio-karaf</artifactId>
  <packaging>jar</packaging>
  <name>${project.artifactId}</name>
  <description>hawtio :: Provides resources for running hawtio in Apache Karaf</description>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>${maven-resources-plugin-version}</version>
        <executions>
          <execution>
            <id>filter</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>resources</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.karaf.tooling</groupId>
        <artifactId>karaf-maven-plugin</artifactId>
        <version>${karaf-version}</version>
        <executions>
          <execution>
            <id>verify</id>
            <phase>process-resources</phase>
            <goals>
              <goal>verify</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>file://${basedir}/target/classes/features.xml</descriptor>
                <descriptor>mvn:org.apache.karaf.features/standard/${karaf-version}/xml/features</descriptor>
                <descriptor>mvn:org.apache.karaf.features/framework/${karaf-version}/xml/features</descriptor>
              </descriptors>
              <distribution>org.apache.karaf.features:framework</distribution>
              <javase>1.8</javase>
              <framework>
                <feature>framework</feature>
              </framework>
              <features>
		<feature>hawtio-*</feature>
              </features>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>${build-helper-maven-plugin-version}</version>
        <executions>
          <execution>
            <id>attach-artifacts</id>
            <phase>package</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>target/classes/features.xml</file>
                  <type>xml</type>
                  <classifier>features</classifier>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.apache.karaf.features</groupId>
      <artifactId>standard</artifactId>
      <version>${karaf-version}</version>
      <type>xml</type>
      <classifier>features</classifier>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.karaf.features</groupId>
      <artifactId>framework</artifactId>
      <version>${karaf-version}</version>
      <type>kar</type>
      <scope>provided</scope>
    </dependency>
  </dependencies>
</project>
