<?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>org.opennms.newts</groupId>
    <artifactId>newts-parent</artifactId>
    <version>3.0.1</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <artifactId>newts-karaf</artifactId>

  <name>New Timeseries Datastore :: Karaf Features</name>

  <packaging>jar</packaging>

  <properties>
    <karafVersion>4.4.6</karafVersion>
  </properties>

  <build>
    <resources>
      <resource>
        <directory>src/main/filtered-resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-artifacts</id>
            <phase>package</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>target/classes/features.xml</file>
                  <classifier>features</classifier>
                  <type>xml</type>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
          <execution>
            <goals>
                <goal>regex-property</goal>
            </goals>
            <configuration>
                <name>osgi.version</name>
                <value>${project.version}</value>
                <regex>-SNAPSHOT</regex>
                <replacement>.SNAPSHOT</replacement>
                <failIfNoMatch>false</failIfNoMatch>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.karaf.tooling</groupId>
        <artifactId>karaf-maven-plugin</artifactId>
        <version>${karafVersion}</version>
        <extensions>true</extensions>
        <configuration>
          <skip>${skipTests}</skip>
        </configuration>
        <executions>
          <execution>
            <id>verify</id>
            <phase>process-resources</phase>
            <goals>
              <goal>verify</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>mvn:org.apache.karaf.features/framework/${karafVersion}/xml/features</descriptor>
                <descriptor>mvn:org.apache.karaf.features/standard/${karafVersion}/xml/features</descriptor>
                <descriptor>mvn:org.apache.karaf.features/enterprise/${karafVersion}/xml/features</descriptor>
                <descriptor>file:${project.build.directory}/classes/features.xml</descriptor>
              </descriptors>
              <distribution>org.apache.karaf.features:framework</distribution>
              <javase>1.8</javase>
              <framework>
                <feature>aries-blueprint</feature>
                <feature>framework</feature>
                <feature>shell</feature>
              </framework>
              <features>
                <feature>netty</feature>
                <feature>cassandra-driver</feature>
                <feature>fastxml-jackson</feature>
                <feature>newts*</feature>
              </features>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.apache.karaf.features</groupId>
      <artifactId>framework</artifactId>
      <type>kar</type>
      <scope>provided</scope>
      <version>${karafVersion}</version>
    </dependency>
  </dependencies>

</project>
