<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.garethahealy.karaf-commands</groupId>
        <artifactId>karaf-commands-parent</artifactId>
        <version>1.0.2</version>
        <relativePath>../</relativePath>
    </parent>
    <artifactId>ensemble-healthy</artifactId>
    <packaging>bundle</packaging>
    <name>GarethHealy :: Karaf Commands :: ensemble-healthy</name>

    <properties>
        <build.osgi.import.before.defaults>
        </build.osgi.import.before.defaults>
        <build.osgi.export.pkg>com.garethahealy.karaf.commands.ensemble.healthy.*</build.osgi.export.pkg>
        <build.osgi.export.service/>
        <build.osgi.activator/>
    </properties>

    <dependencies>
        <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>fabric-api</artifactId>
            <version>${fabric8-version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.fabric8</groupId>
            <artifactId>fabric-commands</artifactId>
            <version>${fabric8-version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.scr.annotations</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <defaultGoal>install</defaultGoal>
        <resources>
            <resource>
                <directory>src/main/features</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-scr-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>scr</goal>
                        </goals>
                        <configuration>
                            <specVersion>1.2</specVersion>
                            <strictMode>false</strictMode>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- copy features.xml to target -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-features</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/features</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- package features.xml for deployment -->
            <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>${project.build.directory}/features/features.xml</file>
                                    <type>xml</type>
                                    <classifier>features</classifier>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
