<?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>
        <groupId>org.opendaylight.odlparent</groupId>
        <artifactId>odlparent</artifactId>
        <version>1.8.4-Carbon</version>
        <relativePath>..//odlparent/odlparent</relativePath>
    </parent>

    <groupId>org.opendaylight.sxp</groupId>
    <artifactId>sxp-parent</artifactId>
    <version>1.4.4-Carbon</version>
    <name>sxp</name> <!-- Used by Sonar to set project name -->
    <packaging>pom</packaging>

    <modules>
        <module>sxp-api</module>
        <module>sxp-core</module>
        <module>sxp-controller</module>
        <module>sxp-cluster-route</module>
        <module>sxp-robot</module>
        <!-- Karaf -->
        <module>sxp-config</module>
        <module>features</module>
    </modules>

    <profiles>
        <profile>
            <id>karaf</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>

            <modules>
                <module>sxp-karaf</module>
            </modules>
        </profile>
    </profiles>

    <properties>
        <!-- Optional TODO: Rename your configfile to taste -->
        <configfilebase>22-sxp-controller-one-node.xml</configfilebase>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <packaging-suffix>jar</packaging-suffix>

        <config.output.base.dir>${project.build.directory}/generated-sources/config</config.output.base.dir>
        <gencode.output.base.dir>${project.build.directory}/generated-sources/sal</gencode.output.base.dir>

        <!-- Plugin Versions -->
        <maven.shade.plugin.version>2.3</maven.shade.plugin.version>

        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <java.version.source>1.8</java.version.source>
        <java.version.target>1.8</java.version.target>

        <yangtools.version>1.1.4-Carbon</yangtools.version>
        <yangtools.feature.version>1.1.4-Carbon</yangtools.feature.version>
        <mdsal.version>1.5.4-Carbon</mdsal.version>
        <mdsal.singleton.version>2.2.4-Carbon</mdsal.singleton.version>
        <mdsal.model.version>0.10.4-Carbon</mdsal.model.version>
        <config.version>0.6.4-Carbon</config.version>
        <restconf.version>1.5.4-Carbon</restconf.version>

        <!-- Yang Module Versions -->
        <ietf-yang-types.version>2013.07.15.10.4-Carbon</ietf-yang-types.version>
        <ietf-inet-types.version>1.2.4-Carbon</ietf-inet-types.version>
        <yang-ext.version>2013.09.07.10.4-Carbon</yang-ext.version>
        <yang-nt.version>2013.10.21.10.4-Carbon</yang-nt.version>

        <!-- EPOLL artifacts -->
        <os.detected.classifier>linux-x86_64</os.detected.classifier>
    </properties>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-artifact</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>${project.groupId}</groupId>
                                    <artifactId>${project.artifactId}</artifactId>
                                    <version>${project.version}</version>
                                    <type>${project.packaging}</type>
                                    <destFileName>
                                        ${project.groupId}.${project.artifactId}-${project.version}.${packaging-suffix}
                                    </destFileName>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>../target</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>${maven.compiler.source}</source>
                        <target>${maven.compiler.target}</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <extensions>true</extensions>
                    <configuration>
                        <instructions>
                            <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
                        </instructions>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>1.8</version>
                    <executions>
                        <execution>
                            <id>add-source</id>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>add-source</goal>
                            </goals>
                            <configuration>
                                <sources>
                                    <source>${config.output.base.dir}</source>
                                    <source>${gencode.output.base.dir}</source>
                                </sources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <configuration>
                        <filesets>
                            <fileset>
                                <directory>../../target</directory>
                                <followSymlinks>false</followSymlinks>
                            </fileset>
                        </filesets>
                    </configuration>
                </plugin>
                <!--This plugin's configuration is used to store Eclipse
                    m2e settings only. It has no influence on the Maven build itself. -->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.opendaylight.yangtools
                                        </groupId>
                                        <artifactId>
                                            yang-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [0.5,)
                                        </versionRange>
                                        <goals>
                                            <goal>
                                                generate-sources
                                            </goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore/>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <finalName>${project.groupId}.${project.artifactId}-${project.version}</finalName>
    </build>

    <dependencyManagement>
        <dependencies>
            <!-- project modules dependencies -->
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>sxp-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>sxp-controller</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>sxp-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <!-- yang model dependencies -->
            <dependency>
                <groupId>org.opendaylight.mdsal.model</groupId>
                <artifactId>ietf-inet-types-2013-07-15</artifactId>
                <version>${ietf-inet-types.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.mdsal.model</groupId>
                <artifactId>ietf-yang-types-20130715</artifactId>
                <version>${ietf-yang-types.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.mdsal.model</groupId>
                <artifactId>yang-ext</artifactId>
                <version>${yang-ext.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.mdsal.model</groupId>
                <artifactId>ietf-topology</artifactId>
                <version>${yang-nt.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.controller</groupId>
                <artifactId>config-api</artifactId>
                <version>${config.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.controller</groupId>
                <artifactId>sal-binding-config</artifactId>
                <version>${mdsal.version}</version>
            </dependency>

            <!-- yangtools dependencies -->
            <dependency>
                <groupId>org.opendaylight.mdsal</groupId>
                <artifactId>yang-binding</artifactId>
                <version>${mdsal.model.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.yangtools</groupId>
                <artifactId>yang-common</artifactId>
                <version>${yangtools.version}</version>
            </dependency>

            <!-- md-sal dependecies -->
            <dependency>
                <groupId>org.opendaylight.controller</groupId>
                <artifactId>sal-binding-api</artifactId>
                <version>${mdsal.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.controller</groupId>
                <artifactId>sal-common-util</artifactId>
                <version>${mdsal.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.mdsal</groupId>
                <artifactId>mdsal-singleton-common-api</artifactId>
                <version>${mdsal.singleton.version}</version>
            </dependency>

            <!-- CSIT testing dependency-->
            <dependency>
                <groupId>com.github.aenniw</groupId>
                <artifactId>jrobot-remote-server</artifactId>
                <version>3.4.2</version>
            </dependency>
            <dependency>
                <groupId>org.robotframework</groupId>
                <artifactId>javalib-core</artifactId>
                <version>1.2.1</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>2.3.2</version>
            </dependency>
            <dependency>
                <groupId>org.apache.xmlrpc</groupId>
                <artifactId>xmlrpc-common</artifactId>
                <version>3.1.3</version>
            </dependency>
            <dependency>
                <groupId>org.apache.ws.commons.util</groupId>
                <artifactId>ws-commons-util</artifactId>
                <version>1.0.2</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
</project>
