<?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>odlparent</artifactId>
    <groupId>org.opendaylight.odlparent</groupId>
    <version>1.9.0</version>
    <relativePath>../odlparent/</relativePath>
  </parent>
  <artifactId>karaf-plugin</artifactId>
  <packaging>maven-plugin</packaging>

  <name>ODL :: odlparent :: ${project.artifactId}</name>

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

  <dependencies>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>3.3.3</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>3.3.3</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model</artifactId>
      <version>3.3.3</version>
    </dependency>
    <dependency>
        <groupId>org.ops4j.pax.url</groupId>
        <artifactId>pax-url-aether</artifactId>
        <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.karaf.features</groupId>
      <artifactId>org.apache.karaf.features.core</artifactId>
      <version>${karaf.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.aether</groupId>
      <artifactId>aether-api</artifactId>
      <version>1.0.2.v20150114</version>
    </dependency>
    <dependency>
      <groupId>org.opendaylight.odlparent</groupId>
      <artifactId>features-test</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.core</artifactId>
      <scope>runtime</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <executions>
          <execution>
            <id>check-license</id>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>process-sources</phase>
            <configuration>
              <configLocation>check-license.xml</configLocation>
              <includeResources>false</includeResources>
              <includeTestResources>false</includeTestResources>
              <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
              <excludes>
                <!-- Skip Apache Licensed files -->
                org/opendaylight/odlparent/PopulateLocalRepoMojo.java
              </excludes>
              <failsOnError>false</failsOnError>
              <consoleOutput>true</consoleOutput>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-plugin-plugin</artifactId>
        <configuration>
          <goalPrefix>karaf</goalPrefix>
          <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
        </configuration>
        <executions>
          <execution>
            <id>mojo-descriptor</id>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </execution>
          <execution>
            <id>help-goal</id>
            <goals>
              <goal>helpmojo</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>run-its</id>
      <build>

        <plugins>
          <plugin>
            <artifactId>maven-invoker-plugin</artifactId>
            <version>2.0.0</version>
            <configuration>
              <debug>true</debug>
              <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
              <pomIncludes>
                <pomInclude>*/pom.xml</pomInclude>
              </pomIncludes>
              <postBuildHookScript>verify</postBuildHookScript>
              <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
              <settingsFile>src/it/settings.xml</settingsFile>
              <goals>
                <goal>clean</goal>
                <goal>test-compile</goal>
              </goals>
            </configuration>
            <executions>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>install</goal>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>

      </build>
    </profile>
  </profiles>

  <!--
    Maven Site Configuration

    The following configuration is necessary for maven-site-plugin to
    correctly identify the correct deployment path for OpenDaylight Maven
    sites.
  -->
  <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>

  <distributionManagement>
    <site>
      <id>opendaylight-site</id>
      <url>${nexus.site.url}/${project.artifactId}/</url>
    </site>
  </distributionManagement>
</project>
