<?xml version="1.0" encoding="UTF-8"?>
<!-- vi: set et smarttab sw=2 tabstop=2: -->
<!--
 Copyright (c) 2015 The Linux Foundation 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>

  <!--
      Note: This parent is not meant to be used by code artifacts. Please use
            odlparent instead.
  -->

  <groupId>org.opendaylight.odlparent</groupId>
  <artifactId>odlparent-lite</artifactId>
  <version>1.6.3-Beryllium-SR3</version>
  <packaging>pom</packaging>

  <licenses>
    <license>
      <name>Eclipse Public License v1.0</name>
      <url>https://www.eclipse.org/legal/epl-v10.html</url>
    </license>
  </licenses>

  <organization>
    <name>OpenDaylight</name>
    <url>https://www.opendaylight.org</url>
  </organization>

  <issueManagement>
    <system>Bugzilla</system>
    <url>https://bugs.opendaylight.org/</url>
  </issueManagement>

  <ciManagement>
    <system>Jenkins</system>
    <url>https://jenkins.opendaylight.org/releng/</url>
  </ciManagement>

  <properties>
    <nexusproxy>https://nexus.opendaylight.org/content</nexusproxy>

    <!-- Variables required for Maven Site generation -->
    <nexus.site.url>file:${user.dir}/target/staged-site</nexus.site.url>
    <odl.site.url>https://nexus.opendaylight.org/content/sites/site/</odl.site.url>
    <stream>latest</stream><!-- CI should pass in -Dstream={stream} -->

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

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.4</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>2.8.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.10.3</version>
          <configuration>
            <tags>
              <!-- support for HelpMojo generated by the maven-plugin-plugin -->
              <tag>
                <name>goal</name>
                <placement>t</placement>
                <head>Goal:</head>
              </tag>
              <tag>
                <name>requiresProject</name>
                <placement>t</placement>
                <head>Requires project:</head>
              </tag>
              <tag>
                <name>threadSafe</name>
                <placement>t</placement>
                <head>Threadsafe</head>
              </tag>
              <tag>
                <name>phase</name>
                <placement>t</placement>
                <head>Phase:</head>
              </tag>
              <!-- end HelpMojo support -->
            </tags>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
        <!-- q = http://memory-alpha.wikia.com/wiki/Q

             The Quick profile is used during incremental local development, when you want to "just get that JAR built",
             which is very handy e.g. for fast hot reloading cycles in Karaf with bundle watch.  It (intentionally!) skips
             tests, quality checks etc. which are great and useful to run before finally submitting changes to Gerrit, and
             which all must run on Gerrit, but which are overhead during ongoing fast iterative local development.

             Note that the idea here is that your IDE will already have run quality checks such as e.g. Checkstyle
             while you typed the code anyway.  Similarly, if you wrote a test, you'll probably already have compiled and run it
             from your IDE, so when you want the OSGi bundle JAR for Karaf, ASAP, you typically don't want all that to run again.
          -->
        <id>q</id>
        <properties>
            <skipTests>true</skipTests>
            <!-- But NOT <maven.test.skip>true, as that's for compiling, not running, tests;
                 and that's usually quick.  Skipping test compilation with -Pq with maven.test.skip would be
                 particularly confusing when used in a project with maven-jar-plugin <goal>test-jar, so don't.)  -->
            <skipIT>true</skipIT>
            <skipITs>true</skipITs>
            <skip.karaf.featureTest>true</skip.karaf.featureTest>
            <jacoco.skip>true</jacoco.skip>
            <maven.javadoc.skip>true</maven.javadoc.skip>
            <maven.source.skip>true</maven.source.skip>
            <checkstyle.skip>true</checkstyle.skip>
            <findbugs.skip>true</findbugs.skip>
            <maven.site.skip>true</maven.site.skip>
            <invoker.skip>true</invoker.skip>
            <enforcer.skip>true</enforcer.skip>
        </properties>
    </profile>
    <profile>
      <!--
          This profile is to ensure we only build javadocs reports
          when we plan to deploy Maven site for our project.

          It activates by checking for the existance of deploy-site.xml in the
          user's current working directory. (Intent is that this is run from
          the Project root directory)
      -->
      <id>maven-site</id>
      <activation>
        <file>
          <exists>${user.dir}/deploy-site.xml</exists>
        </file>
      </activation>

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>

            <executions>
              <execution>
                <id>generate-site</id>
                <phase>install</phase>
                <goals>
                  <goal>site</goal>
                  <goal>attach-descriptor</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>

      <reporting>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <configuration>
              <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <reportSets>
              <reportSet>
                <reports>
                  <report>javadoc</report>
                  <report>test-javadoc</report>
                </reports>
              </reportSet>
            </reportSets>
          </plugin>
        </plugins>
      </reporting>
    </profile>
  </profiles>


  <url>${odl.site.url}/${project.groupId}/${stream}/${project.artifactId}/</url>

  <distributionManagement>
    <repository>
      <id>opendaylight-release</id>
      <url>${nexusproxy}/repositories/opendaylight.release/</url>
    </repository>
    <snapshotRepository>
      <id>opendaylight-snapshot</id>
      <url>${nexusproxy}/repositories/opendaylight.snapshot/</url>
    </snapshotRepository>
    <site>
      <id>opendaylight-site</id>
      <url>${nexus.site.url}/${project.artifactId}/</url>
    </site>
  </distributionManagement>
</project>
