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

  <groupId>com.vmware.photon.controller</groupId>
  <artifactId>photon-model-parent</artifactId>
  <version>0.6.13</version>
  <packaging>pom</packaging>

  <name>photon-model-parent</name>
  <description>
    Photon model is a design and set of libraries for provisioning VMs and containers across different infrastructures
  </description>
  <url>https://github.com/vmware/photon-model</url>

  <licenses>
    <license>
      <name>License</name>
      <url>https://github.com/vmware/photon-model/blob/master/LICENSE</url>
    </license>
    <license>
      <name>Notice</name>
      <url>https://github.com/vmware/photon-model/blob/master/NOTICE</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>George Chrysanthakopoulos</name>
      <email>georgec@vmware.com</email>
      <organization>VMware</organization>
      <organizationUrl>https://www.vmware.com/</organizationUrl>
    </developer>
    <developer>
      <name>Sufian Dar</name>
      <email>dars@vmware.com</email>
      <organization>VMware</organization>
      <organizationUrl>https://www.vmware.com/</organizationUrl>
    </developer>
    <developer>
      <name>Igor Stoyanov</name>
      <email>istoyanov@vmware.com</email>
      <organization>VMware</organization>
      <organizationUrl>https://www.vmware.com/</organizationUrl>
    </developer>
    <developer>
      <name>Gurudutt Belur</name>
      <email>gbelur@vmware.com</email>
      <organization>VMware</organization>
      <organizationUrl>https://www.vmware.com/</organizationUrl>
    </developer>
    <developer>
      <name>Prashant Gadagi</name>
      <email>gadagip@vmware.com</email>
      <organization>VMware</organization>
      <organizationUrl>https://www.vmware.com/</organizationUrl>
    </developer>
    <developer>
      <name>Ankur Soni</name>
      <email>asoni@vmware.com</email>
      <organization>VMware</organization>
      <organizationUrl>https://www.vmware.com/</organizationUrl>
    </developer>
    <developer>
      <name>Surabhi Diwan</name>
      <email>sdiwan@vmware.com</email>
      <organization>VMware</organization>
      <organizationUrl>https://www.vmware.com/</organizationUrl>
    </developer>
    <developer>
      <name>Jonida Cali</name>
      <email>calij@vmware.com</email>
      <organization>VMware</organization>
      <organizationUrl>https://www.vmware.com/</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:vmware/photon-model.git</connection>
    <developerConnection>scm:git:git@github.com:vmware/photon-model.git</developerConnection>
    <url>git@github.com:vmware/photon-model.git</url>
  </scm>

  <modules>
    <module>photon-model</module>
    <module>photon-model-security</module>
    <module>photon-model-tasks</module>
    <module>photon-model-adapters-registry</module>
    <module>photon-model-adapters/util</module>
    <module>photon-model-adapters/aws</module>
    <module>photon-model-adapters/azure</module>
    <module>photon-model-adapters/gcp</module>
    <module>photon-model-adapters/vsphere</module>
  </modules>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <xenon.version>1.4.2</xenon.version>
    <xenon-utils.version>0.0.1</xenon-utils.version>
    <jacoco.version>0.7.9</jacoco.version>
    <!-- Bouncy Castle -->
    <bouncycastle.version>1.54</bouncycastle.version>
  </properties>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <profiles>
    <profile>
      <id>coverage</id>
      <build>
        <plugins>
          <!-- Add JaCoCo arguments to surefire execution -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <argLine>${jacocoSurefireArgLine}</argLine>
            </configuration>
          </plugin>
          <!-- Depend on JaCoCo for coverage reports -->
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>${jacoco.version}</version>
            <executions>
              <execution>
                <id>pre-unit-test</id>
                <phase>test-compile</phase>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
                <configuration>
                  <destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile>
                  <propertyName>jacocoSurefireArgLine</propertyName>
                </configuration>
              </execution>
              <execution>
                <id>post-unit-test</id>
                <phase>test</phase>
                <goals>
                  <goal>report</goal>
                </goals>
                <configuration>
                  <dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</dataFile>
                  <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>release</id>
      <properties>
        <additionalparam>-Xdoclint:none</additionalparam>
      </properties>
      <build>
        <resources>
          <resource>
            <directory>src/main/resources</directory>
            <includes>
              <include>**/*.*</include>
            </includes>
          </resource>
          <resource>
            <directory>target/extra-resources</directory>
          </resource>
        </resources>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.9.1</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.7</version>
            <executions>
              <execution>
                <id>copy-license</id>
                <!-- Bind to initialize phase so that the default resources target
                     picks these files up from target/extra-resources. //-->
                <phase>initialize</phase>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
                <configuration>
                  <outputDirectory>${basedir}/target/extra-resources</outputDirectory>
                  <resources>
                    <resource>
                      <directory>${basedir}/..</directory>
                      <includes>
                        <include>LICENSE</include>
                        <include>NOTICE</include>
                      </includes>
                    </resource>
                  </resources>
                </configuration>
              </execution>
            </executions>
          </plugin>
           <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.7</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>${autoReleaseAfterClose}</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <includes>
          <include>**/*.*</include>
        </includes>
      </resource>
    </resources>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.2</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.2</version>
        <configuration>
          <pushChanges>false</pushChanges>
          <localCheckout>true</localCheckout>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.19.1</version>
        <configuration>
          <argLine>-Xmx256m</argLine>
          <systemPropertyVariables>
            <java.io.tmpdir>${project.basedir}/target</java.io.tmpdir>
          </systemPropertyVariables>
          <trimStackTrace>false</trimStackTrace>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <target>1.8</target>
          <source>1.8</source>
          <compilerId>javac</compilerId>
          <compilerArgs>
            <arg>-Werror</arg>
            <arg>-Xlint</arg>
          </compilerArgs>
          <showWarnings>true</showWarnings>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
              <goal>test-jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.13</version>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>6.11.1</version>
          </dependency>
        </dependencies>
        <configuration>
          <configLocation>checkstyle.xml</configLocation>
          <headerLocation>contrib/header.regexp</headerLocation>
          <encoding>UTF-8</encoding>
          <consoleOutput>true</consoleOutput>
          <failsOnError>true</failsOnError>
          <includeTestSourceDirectory>true</includeTestSourceDirectory>
          <linkXRef>false</linkXRef>
          <excludes>com/vmware/vim25/**</excludes>
        </configuration>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>3.0.0</version>
        <configuration>
          <effort>Max</effort>
          <failOnError>false</failOnError>
          <xmlOutput>true</xmlOutput>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>pl.project13.maven</groupId>
        <artifactId>git-commit-id-plugin</artifactId>
        <version>2.1.10</version>
        <executions>
          <execution>
            <goals>
              <goal>revision</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <generateGitPropertiesFile>true</generateGitPropertiesFile>
          <generateGitPropertiesFilename>src/main/resources/photon-model.git.properties</generateGitPropertiesFilename>
          <excludeProperties>
            <excludeProperty>git.branch.*</excludeProperty>
            <excludeProperty>git.build.*</excludeProperty>
            <excludeProperty>git.commit.message.*</excludeProperty>
            <excludeProperty>git.commit.user.*</excludeProperty>
            <excludeProperty>git.remote.*</excludeProperty>
          </excludeProperties>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>2.8</version>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.shared</groupId>
            <artifactId>maven-shared-jar</artifactId>
            <version>1.1</version>
            <exclusions>
              <exclusion>
                <groupId>org.apache.bcel</groupId>
                <artifactId>bcel</artifactId>
              </exclusion>
            </exclusions>
          </dependency>
          <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>bcel-findbugs</artifactId>
            <version>6.0</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
            <configuration>
              <skipIfEmpty>true</skipIfEmpty>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
