<?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.xenon</groupId>
  <artifactId>xenon-parent</artifactId>
  <version>1.4.1</version>
  <packaging>pom</packaging>

  <name>xenon-parent</name>
  <description>
    Xenon is both a set of software components and a service oriented design pattern. The runtime is
    implemented in Java and acts as the host for the lightweight, asynchronous services. The programming
    model is language agnostic (does not rely on Java specific constructs) so implementations in other
    languages are encouraged.
  </description>
  <url>https://github.com/vmware/xenon</url>

  <licenses>
    <license>
      <name>License</name>
      <url>https://github.com/vmware/xenon/blob/master/LICENSE</url>
    </license>
    <license>
      <name>Notice</name>
      <url>https://github.com/vmware/xenon/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>Tadaya Tsuyukubo</name>
      <email>ttsuyukubo@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>Asaf Kariv</name>
      <email>kariva@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>Vamsi Krishna Brahmajosyula</name>
      <email>vbrahmajosyula@vmware.com</email>
      <organization>VMware</organization>
      <organizationUrl>https://www.vmware.com/</organizationUrl>
    </developer>
    <developer>
      <name>Kenneth Jung</name>
      <email>jungk@vmware.com</email>
      <organization>VMware</organization>
      <organizationUrl>https://www.vmware.com/</organizationUrl>
    </developer>
    <developer>
      <name>Julian Vassev</name>
      <email>jvassev@vmware.com</email>
      <organization>VMware</organization>
      <organizationUrl>https://www.vmware.com/</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:vmware/xenon.git</connection>
    <developerConnection>scm:git:git@github.com:vmware/xenon.git</developerConnection>
    <url>git@github.com:vmware/xenon.git</url>
  </scm>

  <modules>
    <module>xenon-common</module>
    <module>xenon-loader</module>
    <module>xenon-ui</module>
    <module>xenon-loader-test</module>
    <module>xenon-gateway</module>
    <module>xenon-quickstart</module>
  </modules>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <testHeapSizeMb>256</testHeapSizeMb>
    <testThreadStackSizeKb>256</testThreadStackSizeKb>
    <testJvmOpts></testJvmOpts>
    <autoReleaseAfterClose>true</autoReleaseAfterClose>
  </properties>

  <repositories>
    <repository>
      <id>maven-central</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>

  <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>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>development</id>
      <modules>
        <module>xenon-host</module>
        <module>xenon-samples</module>
        <module>xenon-websocket-test</module>
        <module>xenon-quickstart</module>
        <module>xenon-gateway</module>
        <module>xenon-workshop/jan-2017</module>
      </modules>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
    </profile>

    <profile>
      <id>performance</id>
      <modules>
        <module>xenon-host</module>
        <module>xenon-samples</module>
        <module>xenon-websocket-test</module>
        <module>xenon-quickstart</module>
        <module>xenon-gateway</module>
      </modules>
      <properties>
        <testHeapSizeMb>8192</testHeapSizeMb>
        <testThreadStackSizeKb>1024</testThreadStackSizeKb>
      </properties>
    </profile>

    <profile>
      <id>coverage</id>
      <modules>
        <module>xenon-host</module>
        <module>xenon-samples</module>
        <module>xenon-websocket-test</module>
        <module>xenon-quickstart</module>
        <module>xenon-gateway</module>
      </modules>
      <build>
        <plugins>
          <!-- Add JaCoCo arguments to surefire execution -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <argLine>-Xss${testThreadStackSizeKb}k -Xmx${testHeapSizeMb}m ${jacocoSurefireArgLine} ${testJvmOpts}</argLine>
            </configuration>
          </plugin>
          <!-- Depend on JaCoCo for coverage reports -->
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.7.6.201602180812</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>
          </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>
    <plugins>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.2</version>
      </plugin>
      <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>-Xss${testThreadStackSizeKb}k -Xmx${testHeapSizeMb}m ${testJvmOpts}</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>
        <configuration>
          <skip>${skipAnalysis}</skip>
        </configuration>
        <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>
          <skip>${skipAnalysis}</skip>
          <configLocation>checkstyle.xml</configLocation>
          <headerLocation>contrib/header.regexp</headerLocation>
          <encoding>UTF-8</encoding>
          <consoleOutput>true</consoleOutput>
          <failsOnError>true</failsOnError>
          <includeTestSourceDirectory>true</includeTestSourceDirectory>
        </configuration>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>3.7</version>
        <configuration>
          <skip>${skipAnalysis}</skip>
          <linkXRef>false</linkXRef>
          <failOnViolation>true</failOnViolation>
          <includeTests>true</includeTests>
          <verbose>true</verbose>
          <targetJdk>1.8</targetJdk>
          <rulesets>
            <ruleset>${project.parent.basedir}/contrib/pmd.xml</ruleset>
          </rulesets>
        </configuration>
        <executions>
          <execution>
            <id>pmd</id>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- To easily browse the Findbugs problems, do something like this, -->
      <!-- after you have a failed compile phase: -->
      <!-- mvn -pl xenon-common findbugs:gui -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>3.0.4</version>
        <configuration>
          <skip>${skipAnalysis}</skip>
          <effort>Max</effort>
          <xmlOutput>true</xmlOutput>
          <excludeFilterFile>${project.parent.basedir}/findbugs-exclude.xml</excludeFilterFile>
        </configuration>
        <executions>
          <execution>
            <id>analyze-compile</id>
            <phase>compile</phase>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <failOnError>true</failOnError>
            </configuration>
          </execution>
          <execution>
            <id>analyze-site</id>
            <phase>site</phase>
            <goals>
              <goal>findbugs</goal>
            </goals>
            <configuration>
              <failOnError>false</failOnError>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- The "mvn site" command fails due to a BCEL bug -->
      <!-- Using the findbugs version of BCEL fixes it -->
      <!-- BUG: https://issues.apache.org/jira/browse/BCEL-173 -->
      <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>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <!-- Ignore the execution of a number of plugins inside Eclipse -->
          <!-- This speeds up Eclipse development and workarounds any m2e incompatibility errors -->
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <versionRange>[2.10,)</versionRange>
                    <goals>
                      <goal>copy</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <versionRange>[3.7,)</versionRange>
                    <goals>
                      <goal>check</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>findbugs-maven-plugin</artifactId>
                    <versionRange>[3.0.3,)</versionRange>
                    <goals>
                      <goal>check</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <versionRange>[1.3,)</versionRange>
                    <goals>
                      <goal>exec</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore></ignore>
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>
