<?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">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <artifactId>config-subsystem</artifactId>
        <groupId>org.opendaylight.controller</groupId>
        <version>0.2.3</version>
        <relativePath>..</relativePath>
    </parent>
    <artifactId>config-persister-file-adapter</artifactId>
    <name>${project.artifactId}</name>
    <packaging>bundle</packaging>

    <dependencies>
        <!-- compile dependencies -->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>config-persister-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

        <!-- test dependencies -->
        <dependency>
            <groupId>org.opendaylight.yangtools</groupId>
            <artifactId>mockito-configuration</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>config-persister-api</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- workaround for creating version according to OSGi specification (major.minor.micro[.qualifier] -->
            <plugin>
                <groupId>org.codehaus.groovy.maven</groupId>
                <artifactId>gmaven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                        <configuration>
                            <source>
                                System.setProperty("osgiversion", "${project.version}".replace('-', '.'))
                            </source>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <instructions>
                        <Fragment-Host>${project.groupId}.config-persister-impl;bundle-version=${osgiversion}
                        </Fragment-Host>
                        <Provide-Capability>org.opendaylight.controller.config.persister.storage.adapter
                        </Provide-Capability>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
