<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2021 PANTHEON.tech s.r.o. 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 https://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>io.lighty.core</groupId>
        <artifactId>lighty-parent</artifactId>
        <version>16.2.0</version>
        <relativePath>../../lighty-core/lighty-parent/pom.xml</relativePath>
    </parent>

    <groupId>io.lighty.modules</groupId>
    <artifactId>lighty-bgp</artifactId>
    <version>16.2.0</version>

    <dependencies>
        <dependency>
            <groupId>io.lighty.core</groupId>
            <artifactId>lighty-controller</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.bgpcep</groupId>
            <artifactId>bgp-rib-impl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.bgpcep</groupId>
            <artifactId>bgp-rib-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.bgpcep</groupId>
            <artifactId>bgp-openconfig-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.bgpcep</groupId>
            <artifactId>bgp-topology-provider</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.bgpcep</groupId>
            <artifactId>graph-impl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.bgpcep</groupId>
            <artifactId>bgp-openconfig-rp-impl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.bgpcep</groupId>
            <artifactId>bgp-openconfig-rp-statement</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.bgpcep</groupId>
            <artifactId>bgp-openconfig-state</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.bgpcep</groupId>
            <artifactId>config-loader-impl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.bgpcep</groupId>
            <artifactId>bgp-config-example</artifactId>
        </dependency>
        <!-- BGP Extensions -->
        <dependency>
            <groupId>org.opendaylight.bgpcep</groupId>
            <artifactId>bgp-evpn</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.bgpcep</groupId>
            <artifactId>bgp-flowspec</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.bgpcep</groupId>
            <artifactId>bgp-inet</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.bgpcep</groupId>
            <artifactId>bgp-l3vpn</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.bgpcep</groupId>
            <artifactId>bgp-labeled-unicast</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.bgpcep</groupId>
            <artifactId>bgp-linkstate</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.bgpcep</groupId>
            <artifactId>bgp-mvpn</artifactId>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.bgpcep</groupId>
            <artifactId>bgp-route-target</artifactId>
        </dependency>

        <!-- Test -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.lighty.resources</groupId>
            <artifactId>singlenode-configuration</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <!-- Copies BGP default policies resource initial/routing-policy-config.xml to local resources -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <includeGroupIds>org.opendaylight.bgpcep</includeGroupIds>
                            <includeArtifactIds>bgp-config-example</includeArtifactIds>
                            <excludeTransitive>true</excludeTransitive>
                            <outputDirectory>${project.build.directory}/initial-bgp-config</outputDirectory>
                            <includes>initial/routing-policy-config.xml</includes>
                            <overWriteReleases>true</overWriteReleases>
                            <overWriteSnapshots>true</overWriteSnapshots>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>${project.build.directory}/initial-bgp-config</directory>
            </resource>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
            </resource>
        </resources>
    </build>

</project>