<?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>

    <prerequisites>
        <maven>3.0.4</maven>
    </prerequisites>

    <parent>
        <groupId>org.opendaylight.odlparent</groupId>
        <artifactId>odlparent</artifactId>
        <version>1.7.0-Boron</version>
        <relativePath>..//odlparent/odlparent</relativePath>
    </parent>

    <groupId>org.opendaylight.sfc</groupId>
    <artifactId>sfc-parent</artifactId>
    <version>0.3.0-Boron</version>
    <name>sfc</name> <!-- Used by Sonar to set project name -->
    <packaging>pom</packaging>

    <!-- The following sections are for compatability with Maven Central -->
    <description>Open Daylight SDN controller Service Function Chaining application</description>
    <url>https://wiki.opendaylight.org/view/Service_Function_Chaining:Main</url>
    <licenses>
      <license>
        <name>Eclipse Public License v1.0</name>
        <url>http://www.eclipse.org/legal/epl-v10.html</url>
      </license>
    </licenses>
    <scm>
      <connection>scm:git:ssh://git.opendaylight.org:29418/sfc.git</connection>
      <developerConnection>scm:git:ssh://git.opendaylight.org:29418/sfc.git</developerConnection>
      <url>https://wiki.opendaylight.org/view/Service_Function_Chaining:Main</url>
      <tag>HEAD</tag>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- Build Plugin Versions -->
        <karaf.maven.version>3.0.1</karaf.maven.version>

        <config.version>0.5.0-Boron</config.version>
        <mdsal.version>1.4.0-Boron</mdsal.version>
        <netconf.parent.version>1.1.0-Boron</netconf.parent.version>
        <restconf.version>1.4.0-Boron</restconf.version>
        <jmxGeneratorPath>src/main/yang-gen-config</jmxGeneratorPath>
        <salGeneratorPath>src/main/yang-gen-sal</salGeneratorPath>

        <yangtools.version>1.0.0-Boron</yangtools.version>
        <mdsal.model.version>0.9.0-Boron</mdsal.model.version>


        <lispflowmapping.version>1.4.0-Boron</lispflowmapping.version>
        <ovsdb.southbound.version>1.3.0-Boron</ovsdb.southbound.version>
        <l2switch.version>0.4.0-Boron</l2switch.version>

        <genius.version>0.1.0-Boron</genius.version>

        <!-- Supporting Libraries -->
        <feature.openflowplugin.version>0.3.0-Boron</feature.openflowplugin.version>
        <openflowplugin.version>0.3.0-Boron</openflowplugin.version>

        <branding.version>1.3.0-Boron</branding.version>
        <karaf.resources.version>1.7.0-Boron</karaf.resources.version>
        <karaf.empty.version>1.7.0-Boron</karaf.empty.version>
        <pax.logging.service.version>1.8.2</pax.logging.service.version>
        <pax.logging.api.version>1.8.2</pax.logging.api.version>
        <dlux.version>0.4.0-Boron</dlux.version>

        <!-- Test Libraries -->
        <junitparams.version>1.0.3</junitparams.version>
        <javafasterxml.version>3.1.3</javafasterxml.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.opendaylight.sfc</groupId>
                <artifactId>sfc-model</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.sfc</groupId>
                <artifactId>sfc-provider</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.sfc</groupId>
                <artifactId>sfc-ovs</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.sfc</groupId>
                <artifactId>sfc-test-consumer</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.sfc</groupId>
                <artifactId>sfc-openflow-utils</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.sfc</groupId>
                <artifactId>sfc-vnfm-spi</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.controller</groupId>
                <artifactId>config-api</artifactId>
                <version>${config.version}</version>
            </dependency>

            <!-- YANG tools -->
            <dependency>
                <groupId>org.opendaylight.yangtools</groupId>
                <artifactId>yangtools-artifacts</artifactId>
                <version>${yangtools.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.mdsal</groupId>
                <artifactId>mdsal-artifacts</artifactId>
                <version>2.1.0-Boron</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.mdsal.model</groupId>
                <artifactId>mdsal-model-artifacts</artifactId>
                <version>${mdsal.model.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- Controller infrastructure -->
            <dependency>
                <groupId>org.opendaylight.controller</groupId>
                <artifactId>config-artifacts</artifactId>
                <version>${config.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.controller</groupId>
                <artifactId>mdsal-artifacts</artifactId>
                <version>${mdsal.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.netconf</groupId>
                <artifactId>restconf-artifacts</artifactId>
                <version>${restconf.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.netconf</groupId>
                <artifactId>netconf-artifacts</artifactId>
                <version>${netconf.parent.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.ovsdb</groupId>
                <artifactId>southbound-api</artifactId>
                <version>${ovsdb.southbound.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <distributionManagement>
        <!-- OpenDayLight Released artifact -->
        <repository>
            <id>opendaylight-release</id>
            <url>${nexusproxy}/repositories/opendaylight.release</url>
        </repository>
        <!-- OpenDayLight Snapshot artifact -->
        <snapshotRepository>
            <id>opendaylight-snapshot</id>
            <url>${nexusproxy}/repositories/opendaylight.snapshot</url>
        </snapshotRepository>
    </distributionManagement>

    <modules>
        <module>sfc-model</module>
        <module>sfc-provider</module>
        <module>sfc-test-consumer</module>
        <module>sfc-ui</module>
        <module>sfc-sb-rest</module>
        <module>sfclisp</module>
        <module>sfc-util</module>
        <module>sfc-scf-openflow</module>
        <module>sfc-ovs</module>
        <module>sfc-netconf</module>
        <module>sfc-config</module>
        <module>sfc-jsonconfig</module>
        <module>sfc-vnfm-spi</module>
        <module>sfc-vnfm-tacker</module>
        <module>sfc-pot</module>
        <module>features</module>
        <module>sfc-karaf</module>
        <module>sfc-bootstrap</module>
        <module>sfc-renderers</module>
        <module>sfc-rsp-manager</module>
        <module>sfc-genius</module>
    </modules>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <configuration>
                        <filesets>
                            <fileset>
                                <directory>${jmxGeneratorPath}</directory>
                                <includes>
                                    <include>**</include>
                                </includes>
                            </fileset>
                            <fileset>
                                <directory>${salGeneratorPath}</directory>
                                <includes>
                                    <include>**</include>
                                </includes>
                            </fileset>
                        </filesets>
                    </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>${jmxGeneratorPath}</source>
                                    <source>${salGeneratorPath}</source>
                                </sources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.opendaylight.yangtools</groupId>
                    <artifactId>yang-maven-plugin</artifactId>
                    <version>${yangtools.version}</version>
                    <executions>
                        <execution>
                            <id>config</id>
                            <goals>
                                <goal>generate-sources</goal>
                            </goals>
                            <configuration>
                                <codeGenerators>
                                    <generator>
                                        <codeGeneratorClass>org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator</codeGeneratorClass>
                                        <outputBaseDir>${jmxGeneratorPath}</outputBaseDir>
                                        <additionalConfiguration>
                                            <namespaceToPackage1>urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang</namespaceToPackage1>
                                        </additionalConfiguration>
                                    </generator>
                                    <generator>
                                        <codeGeneratorClass>org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl</codeGeneratorClass>
                                        <outputBaseDir>${salGeneratorPath}</outputBaseDir>
                                    </generator>
                                </codeGenerators>
                                <inspectDependencies>true</inspectDependencies>
                            </configuration>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.opendaylight.controller</groupId>
                            <artifactId>yang-jmx-generator-plugin</artifactId>
                            <version>${config.version}</version>
                            <scope>compile</scope>
                        </dependency>
                        <dependency>
                            <groupId>org.opendaylight.mdsal</groupId>
                            <artifactId>maven-sal-api-gen-plugin</artifactId>
                            <version>${mdsal.model.version}</version>
                            <scope>compile</scope>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <executions>
                        <execution>
                            <phase>process-sources</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <failsOnError>true</failsOnError>
                        <configLocation>checkstyle.xml</configLocation>
                        <consoleOutput>true</consoleOutput>
                        <includeTestSourceDirectory>true</includeTestSourceDirectory>
                        <sourceDirectory>${project.basedir}</sourceDirectory>
                        <includes>**\/*.yang,**\/*.java,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat</includes>
                        <excludes>**\/target\/,**\/bin\/,**\/third-party,**\/yang-gen-sal\/,**\/node\/,**\/node_modules\/, **\/vendor\/</excludes>
                    </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>
                        <manifestLocation>${project.build.directory}/META-INF</manifestLocation>
                    </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>
                                        <execute/>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-checkstyle-plugin</artifactId>
                                        <versionRange>[2.13,)</versionRange>
                                        <goals>
                                            <goal>check</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <execute/>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>
