<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2014 Red Hat, Inc. and others. All rights reserved.

This program and the accompanying materials are made available under the
terms of the Eclipse Public License v1.0 which accompanies this distribution,
and is available at http://www.eclipse.org/legal/epl-v10.html
-->
<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.5.1-Lithium-SR1</version>
    <relativePath>../../../odlparent/odlparent</relativePath>
  </parent>

  <groupId>org.opendaylight.ovsdb</groupId>
  <artifactId>commons</artifactId>
  <name>${project.artifactId}.parent</name>
  <version>1.3.1-Lithium-SR1</version>
  <packaging>pom</packaging>
  <description>The OVSDB Plugin integration project is a project for OpenDaylight that will implement the Open vSwitch Database RFC 7047 management protocol allowing the Southbound configuration of vSwitches and a network virtualization implementation.</description>
  <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
  <licenses>
    <license>
      <name>Eclipse Public License v1.0</name>
      <url>http://www.eclipse.org/legal/epl-v10.html</url>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Sam Hague</name>
      <email>shague@gmail.com</email>
      <url>https://github.com/shague</url>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</connection>
    <developerConnection>scm:git:ssh://git.opendaylight.org:29418/ovsdb.git</developerConnection>
    <tag>HEAD</tag>
    <url>https://wiki.opendaylight.org/view/OVSDB_Integration:Main</url>
  </scm>

  <prerequisites>
    <maven>3.1.1</maven>
  </prerequisites>

  <properties>
    <lifecycle.mapping.version>1.0.0</lifecycle.mapping.version>
    <!-- Surefire/Failsafe Arguments -->
    <argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
    <!-- OVSDB Component Versions -->
    <openstack.netvirt.version>1.1.1-Lithium-SR1</openstack.netvirt.version>
    <openstack.netvirt.providers.version>1.1.1-Lithium-SR1</openstack.netvirt.providers.version>
    <ovsdb.features.version>1.1.1-Lithium-SR1</ovsdb.features.version>
    <ovsdb.library.version>1.1.1-Lithium-SR1</ovsdb.library.version>
    <ovsdb.northbound.version>0.7.1-Lithium-SR1</ovsdb.northbound.version>
    <ovsdb.plugin.version>1.1.1-Lithium-SR1</ovsdb.plugin.version>
    <ovsdb.plugin.compatibility.layer.version>1.1.1-Lithium-SR1</ovsdb.plugin.compatibility.layer.version>
    <ovsdb.ovssfc.version>0.1.1-Lithium-SR1</ovsdb.ovssfc.version>
    <ovsdb.utils.config.version>1.1.1-Lithium-SR1</ovsdb.utils.config.version>
    <ovsdb.utils.mdsal.node.version>1.1.1-Lithium-SR1</ovsdb.utils.mdsal.node.version>
    <ovsdb.utils.mdsal.openflow.version>1.1.1-Lithium-SR1</ovsdb.utils.mdsal.openflow.version>
    <ovsdb.utils.servicehelper.version>1.1.1-Lithium-SR1</ovsdb.utils.servicehelper.version>
    <plugin.shell.version>1.1.1-Lithium-SR1</plugin.shell.version>
    <schema.hardwarevtep.version>1.1.1-Lithium-SR1</schema.hardwarevtep.version>
    <schema.openvswitch.version>1.1.1-Lithium-SR1</schema.openvswitch.version>
    <!-- Skip Coverage and IT by default -->
    <skip.coverage>true</skip.coverage>
    <skip.distribution>false</skip.distribution>
    <skip.integrationtest>true</skip.integrationtest>
    <skip.karaf.featureTest>false</skip.karaf.featureTest>
    <!-- The directory where maven was executed TODO see if this can be removed -->
    <root.directory>${env.PWD}</root.directory>
    <!-- IT report is aggregated to enable PAX Exam coverage to be logged -->
    <sonar.jacoco.itReportPath>${root.directory}/target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
    <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
    <!-- ODL Dependency Versions -->
    <clustering.services.version>0.6.1-Lithium-SR1</clustering.services.version>
    <containermanager.version>0.6.1-Lithium-SR1</containermanager.version>
    <controller.config.version>0.3.1-Lithium-SR1</controller.config.version>
    <forwardingrulesmanager.version>0.7.1-Lithium-SR1</forwardingrulesmanager.version>
    <mdsal.version>1.2.1-Lithium-SR1</mdsal.version>
    <networkconfig.neutron.version>0.5.1-Lithium-SR1</networkconfig.neutron.version>
    <northbound.commons.version>0.5.1-Lithium-SR1</northbound.commons.version>
    <nsf.version>0.5.1-Lithium-SR1</nsf.version>
    <odl.karaf.base.version>1.5.1-Lithium-SR1</odl.karaf.base.version>
    <odlparent.version>1.5.1-Lithium-SR1</odlparent.version>
    <openflowjava-nicira.version>0.1.1-Lithium-SR1</openflowjava-nicira.version>
    <openflowjava-extension.version>0.1.1-Lithium-SR1</openflowjava-extension.version>
    <openflowjava.version>0.6.1-Lithium-SR1</openflowjava.version>
    <openflowplugin.version>0.1.1-Lithium-SR1</openflowplugin.version>
    <sal.version>0.9.1-Lithium-SR1</sal.version>
    <switchmanager.api.version>0.8.1-Lithium-SR1</switchmanager.api.version>
    <yangtools.version>0.7.1-Lithium-SR1</yangtools.version>
    <!-- 3rd Pary Dependency Versions -->
    <commons.collection.version>1.0</commons.collection.version>
    <httpcomponents.version>4.2.1</httpcomponents.version>
    <portlet.version>2.0</portlet.version>
    <powermock.version>1.5.2</powermock.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>${commons.collection.version}</version>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-all</artifactId>
        <version>${netty.version}</version>
      </dependency>
      <dependency>
        <groupId>javax.portlet</groupId>
        <artifactId>portlet-api</artifactId>
        <version>${portlet.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore-nio</artifactId>
        <version>${httpcomponents.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.controller</groupId>
        <artifactId>commons.northbound</artifactId>
        <version>${northbound.commons.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.controller</groupId>
        <artifactId>config-api</artifactId>
        <version>${controller.config.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.controller</groupId>
        <artifactId>clustering.services</artifactId>
        <version>${clustering.services.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.controller</groupId>
        <artifactId>containermanager</artifactId>
        <version>${containermanager.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.controller</groupId>
        <artifactId>forwardingrulesmanager</artifactId>
        <version>${forwardingrulesmanager.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.neutron</groupId>
        <artifactId>neutron-spi</artifactId>
        <version>${networkconfig.neutron.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.controller</groupId>
        <artifactId>opendaylight-karaf-empty</artifactId>
        <version>1.5.1-Lithium-SR1</version>
        <type>zip</type>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.controller</groupId>
        <artifactId>sal</artifactId>
        <version>${sal.version}</version>
      </dependency>

      <dependency>
        <groupId>org.opendaylight.yangtools</groupId>
        <artifactId>yangtools-artifacts</artifactId>
        <version>${yangtools.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.controller</groupId>
        <artifactId>config-artifacts</artifactId>
        <version>${controller.config.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </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.openflowjava</groupId>
        <artifactId>openflowjava-artifacts</artifactId>
        <version>${openflowjava.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>org.opendaylight.controller</groupId>
        <artifactId>switchmanager</artifactId>
        <version>${switchmanager.api.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.openflowplugin.model</groupId>
        <artifactId>model-flow-base</artifactId>
        <version>${openflowplugin.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.openflowplugin.model</groupId>
        <artifactId>model-flow-service</artifactId>
        <version>${openflowplugin.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.openflowplugin.model</groupId>
        <artifactId>model-flow-statistics</artifactId>
        <version>${openflowplugin.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.odlparent</groupId>
        <artifactId>features-test</artifactId>
        <version>${odlparent.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.openflowplugin</groupId>
        <artifactId>openflowplugin</artifactId>
        <version>${openflowplugin.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.openflowplugin</groupId>
        <artifactId>openflowjava-extension-nicira</artifactId>
        <version>${openflowjava-nicira.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.openflowplugin</groupId>
        <artifactId>openflowjava-extension-nicira-api</artifactId>
        <version>${openflowjava-nicira.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.openflowplugin</groupId>
        <artifactId>openflowplugin-extension-api</artifactId>
        <version>${openflowplugin.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.openflowplugin</groupId>
        <artifactId>openflowplugin-extension-nicira</artifactId>
        <version>${openflowplugin.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.openflowplugin</groupId>
        <artifactId>openflowplugin-extension-nicira-config</artifactId>
        <version>${openflowplugin.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.ovsdb</groupId>
        <artifactId>features-ovsdb</artifactId>
        <version>${ovsdb.features.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.ovsdb</groupId>
        <artifactId>library</artifactId>
        <version>${ovsdb.library.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.ovsdb</groupId>
        <artifactId>northbound</artifactId>
        <version>${ovsdb.northbound.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.ovsdb</groupId>
        <artifactId>openstack.net-virt</artifactId>
        <version>${openstack.netvirt.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.ovsdb</groupId>
        <artifactId>openstack.net-virt-providers</artifactId>
        <version>${openstack.netvirt.providers.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.ovsdb</groupId>
        <artifactId>ovsdb-plugin-compatibility-layer</artifactId>
        <version>${ovsdb.plugin.compatibility.layer.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.ovsdb</groupId>
        <artifactId>plugin</artifactId>
        <version>${ovsdb.plugin.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.ovsdb</groupId>
        <artifactId>plugin-mdsal-adapter</artifactId>
        <version>${ovsdb.plugin.adapter.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.ovsdb</groupId>
        <artifactId>plugin-shell</artifactId>
        <version>${plugin.shell.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.ovsdb</groupId>
        <artifactId>schema.hardwarevtep</artifactId>
        <version>${schema.hardwarevtep.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.ovsdb</groupId>
        <artifactId>schema.openvswitch</artifactId>
        <version>${schema.openvswitch.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.ovsdb</groupId>
        <artifactId>utils.config</artifactId>
        <version>${ovsdb.utils.config.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.ovsdb</groupId>
        <artifactId>utils.mdsal-node</artifactId>
        <version>${ovsdb.utils.mdsal.node.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.ovsdb</groupId>
        <artifactId>utils.mdsal-openflow</artifactId>
        <version>${ovsdb.utils.mdsal.openflow.version}</version>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.ovsdb</groupId>
        <artifactId>utils.servicehelper</artifactId>
        <version>${ovsdb.utils.servicehelper.version}</version>
      </dependency>
      <dependency>
        <groupId>org.powermock</groupId>
        <artifactId>powermock-module-junit4</artifactId>
        <version>${powermock.version}</version>
      </dependency>
      <dependency>
        <groupId>org.powermock</groupId>
        <artifactId>powermock-api-mockito</artifactId>
        <version>${powermock.version}</version>
      </dependency>
      <dependency>
        <groupId>org.powermock</groupId>
        <artifactId>powermock-core</artifactId>
        <version>${powermock.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <configuration>
            <source>${java.version.source}</source>
            <target>${java.version.target}</target>
            <testSource>${java.version.source}</testSource>
            <testTarget>${java.version.target}</testTarget>
          </configuration>
        </plugin>
        <!-- This configuration should move to ODL-Parent -->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>${lifecycle.mapping.version}</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>properties-maven-plugin</artifactId>
                    <versionRange>[0.0,)</versionRange>
                    <goals>
                      <goal>set-system-properties</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore/>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <versionRange>[0.0,)</versionRange>
                    <goals>
                      <goal>prepare-agent</goal>
                      <goal>pre-test</goal>
                      <goal>post-test</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore/>
                  </action>
                </pluginExecution>
                <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>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>6.4.1</version>
            </dependency>
          </dependencies>
          <configuration>
            <configLocation>src/main/resources/ovsdb_checks.xml</configLocation>
            <failsOnError>true</failsOnError>
            <includes>**/*.java,**/*.xml,**/*.ini,**/*.sh,**/*.bat</includes>
            <excludes>**/yang/,**/features/,**/integrationtest/,**/northbound/,
              **/openstack/,**/ovs-sfc/,
              **/ovsdb-plugin-compatibility-layer/,
              **/plugin/,**/plugin-shell/,
              **/schema/hardwarevtep/,**/schema/openvswitch/,
              **/southbound/,**/utils/
            </excludes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${jacoco.version}</version>
          <configuration>
            <skip>${skip.coverage}</skip>
          </configuration>
          <executions>
            <execution>
              <id>pre-unit-test</id>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
              <configuration>
                <destFile>${sonar.jacoco.reportPath}</destFile>
              </configuration>
            </execution>
            <execution>
              <id>pre-integration-test</id>
              <goals>
                <goal>prepare-agent-integration</goal>
              </goals>
              <configuration>
                <destFile>${sonar.jacoco.itReportPath}</destFile>
                <append>true</append>
                <skip>${skip.integrationtest}</skip>
              </configuration>
            </execution>
            <execution>
              <id>post-unit-test</id>
              <goals>
                <goal>report</goal>
              </goals>
              <configuration>
                <dataFile>${sonar.jacoco.reportPath}</dataFile>
              </configuration>
            </execution>
            <execution>
              <id>post-integration-test</id>
              <goals>
                <goal>report-integration</goal>
              </goals>
              <configuration>
                <dataFile>${sonar.jacoco.itReportPath}</dataFile>
                <skip>${skip.integrationtest}</skip>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <executions>
            <execution>
              <id>failsafe-integration-tests</id>
              <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
              </goals>
              <configuration>
                <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
                <skipTests>${skip.integrationtest}</skipTests>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.opendaylight.yangtools</groupId>
          <artifactId>yang-maven-plugin</artifactId>
          <version>${yangtools.version}</version>
          <executions>
            <execution>
              <goals>
                <goal>generate-sources</goal>
              </goals>
              <configuration>
                <!-- directory containing yang files to parse and generate code -->
                <yangFilesRootDir>src/main/yang</yangFilesRootDir>
                <codeGenerators>
                  <generator>
                    <codeGeneratorClass>
                      org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl
                    </codeGeneratorClass>
                    <!-- directory into which generated files will be placed -->
                    <outputBaseDir>
                      target/generated-sources/sal
                    </outputBaseDir>
                  </generator>
                </codeGenerators>
                <inspectDependencies>true</inspectDependencies>
              </configuration>
            </execution>
          </executions>
          <dependencies>
            <dependency>
              <groupId>org.opendaylight.yangtools</groupId>
              <artifactId>maven-sal-api-gen-plugin</artifactId>
              <version>${yangtools.version}</version>
              <type>jar</type>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>1.7</version>
          <executions>
            <execution>
              <phase>generate-sources</phase>
              <goals>
                <goal>add-source</goal>
              </goals>
              <configuration>
                <sources>
                  <source>target/generated-sources/sal</source>
                </sources>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>integrationtest</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <properties>
        <skip.integrationtest>false</skip.integrationtest>
      </properties>
    </profile>
    <profile>
      <id>coverage</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <properties>
        <skip.coverage>false</skip.coverage>
      </properties>
    </profile>
    <profile>
      <id>jenkins</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <properties>
        <skip.distribution>true</skip.distribution>
        <root.directory>${env.WORKSPACE}</root.directory>
      </properties>
    </profile>
    <profile>
      <id>karaf</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <properties>
        <skip.karaf.featureTest>false</skip.karaf.featureTest>
      </properties>
    </profile>
  </profiles>
</project>
