<?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>org.pentaho</groupId>
  <artifactId>pentaho-parent-pom</artifactId>
  <version>8.1.0.0-365</version>
  <packaging>pom</packaging>

  <!--
    NOTICE!  Please consider this to be an abstract parent pom and DO NOT inherit from it directly.

    use pentaho-ce-parent-pom, or something extending from it, for public projects
   -->

  <name>Pentaho Project Parent Pom</name>
  <description>top-level abstract parent pom for all Pentaho CE projects</description>
  <url>http://wwww.pentaho.org</url>
   
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  
  <scm>
    <developerConnection>scm:git:git@github.com:pentaho/maven-parent-poms.git</developerConnection>
    <url>https://github.com/pentaho/maven-parent-poms</url>
    <tag>pentaho-parent-pom-8.1.0.0-365</tag>
  </scm>

  <modules>
    <module>pentaho-ce-parent-pom</module>
  </modules>

  <organization>
    <name>Hitachi Vantara</name>
    <url>http://www.pentaho.com</url>
  </organization>

  <developers>
    <developer>
      <name>Pentaho Build Team</name>
      <email>buildteam@pentaho.com</email>
      <roles>
        <role>creator</role>
        <role>maintainer</role>
      </roles>
    </developer>
  </developers>

  <issueManagement>
    <system>JIRA</system>
    <url>http://jira.pentaho.com</url>
  </issueManagement>

  <ciManagement>
    <system>Jenkins</system>
    <url>http://ci.pentaho.com</url>
  </ciManagement>

  <properties>
    <!-- VERSIONS -->
    <jacoco-maven-plugin.version>0.8.0</jacoco-maven-plugin.version>
    <maven-clean-plugin.version>3.0.0</maven-clean-plugin.version>
    <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
    <maven-install-plugin.version>2.5.2</maven-install-plugin.version>
    <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
    <maven-site-plugin.version>3.4</maven-site-plugin.version>
    <maven-dependency-plugin.version>2.10</maven-dependency-plugin.version>
    <build-helper-maven-plugin.version>3.0.0</build-helper-maven-plugin.version>
    <requirejs-maven-plugin.version>2.0.4</requirejs-maven-plugin.version>
    <frontend-maven-plugin.version>1.3</frontend-maven-plugin.version>
    <maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
    <iterator-maven-plugin.version>0.4</iterator-maven-plugin.version>
    <maven-assembly-plugin.version>3.1.0</maven-assembly-plugin.version>
    <maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
    <maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
    <maven-failsafe-plugin.version>2.21.0</maven-failsafe-plugin.version>
    <maven-jar-plugin.version>2.6</maven-jar-plugin.version>
    <maven-javadoc-plugin.version>2.10.3</maven-javadoc-plugin.version>
    <maven-jxr-plugin.version>2.5</maven-jxr-plugin.version>
    <maven-project-info-reports-plugin.version>2.9</maven-project-info-reports-plugin.version>
    <maven-resources-plugin.version>3.0.2</maven-resources-plugin.version>
    <maven-source-plugin.version>2.4</maven-source-plugin.version>
    <maven-surefire-plugin.version>2.21.0</maven-surefire-plugin.version>
    <maven-surefire-report-plugin.version>2.21.0</maven-surefire-report-plugin.version>
    <maven-verifier-plugin.version>1.1</maven-verifier-plugin.version>
    <sonar-maven-plugin.version>2.7.1</sonar-maven-plugin.version>
    <license-helper-maven-plugin.version>1.26</license-helper-maven-plugin.version>
    <maven-war-plugin.version>3.2.0</maven-war-plugin.version>
    <!-- DO NOT, under ANY circumstance, use maven-bundle-plugin verion 2.5.4, it overrides all phase bindings with the default,
       and generally just makes a mess of things -->
    <maven-bundle-plugin.version>2.5.3</maven-bundle-plugin.version>

    <nodejs.version>v8.10.0</nodejs.version>
    <npm.version>4.6.1</npm.version>
    <rjs.version>2.1.19</rjs.version>

    <!-- jdk version -->
    <source.jdk.version>1.8</source.jdk.version>
    <target.jdk.version>1.8</target.jdk.version>
    <checkstyle.version>8.0</checkstyle.version>
    <coding-standards.version>8.1.0.0-SNAPSHOT</coding-standards.version>
    <spotbugs.version>3.1.2</spotbugs.version>

    <!-- PHASE BINDINGS -->
    <set-highest-basedir-phase>initialize</set-highest-basedir-phase>
    <node-npm_install-phase>initialize</node-npm_install-phase>
    <eula-wrap_assign-deps-to-properties-phase>initialize</eula-wrap_assign-deps-to-properties-phase>
    <bundle-javascript_unpack-rjs-phase>initialize</bundle-javascript_unpack-rjs-phase>
    <javascript_unpack-dependencies-phase>initialize</javascript_unpack-dependencies-phase>
    <javascript_transpile_custom_properties-phase>validate</javascript_transpile_custom_properties-phase>
    <javascript_override-profilebuilder-phase>process-resources</javascript_override-profilebuilder-phase>
    <bundle-javascript_optimize-phase>generate-sources</bundle-javascript_optimize-phase>
    <bundle-javascript_transpile_optimize-phase>generate-sources</bundle-javascript_transpile_optimize-phase>
    <bundle-javascript_add-resource-phase>process-sources</bundle-javascript_add-resource-phase>
    <bundle-sass_optimize-phase>process-sources</bundle-sass_optimize-phase>
    <generate-bundle-manifest-phase>compile</generate-bundle-manifest-phase>
    <javascript-transpile_cleanup-phase>compile</javascript-transpile_cleanup-phase>
    <javascript-test_copy-resources-phase>generate-test-resources</javascript-test_copy-resources-phase>
    <javascript-test_npm-install-phase>generate-test-resources</javascript-test_npm-install-phase>
    <test-unit-execute-phase>test</test-unit-execute-phase>
    <javascript-test_karma-phase>test</javascript-test_karma-phase>
    <javascript-requirecfg_aggregate-phase>prepare-package</javascript-requirecfg_aggregate-phase>
    <javascript_optimize-phase>prepare-package</javascript_optimize-phase>
    <assembly_package-phase>package</assembly_package-phase>
    <assembly_appendId>false</assembly_appendId>
    <javascript-assembly_package-phase>package</javascript-assembly_package-phase>
    <test-integration_add-resources-phase>pre-integration-test</test-integration_add-resources-phase>
    <test-integration_add-source-phase>pre-integration-test</test-integration_add-source-phase>
    <test-integration_compile-phase>pre-integration-test</test-integration_compile-phase>
    <test-integration_execute-phase>integration-test</test-integration_execute-phase>
    <eula-wrap_create-izpack-installer-jar-phase>verify</eula-wrap_create-izpack-installer-jar-phase>
    <eula-wrap_create-dist-phase>verify</eula-wrap_create-dist-phase>
    <eula-wrap_attach-dist-phase>verify</eula-wrap_attach-dist-phase>
    <attach-sources-phase>verify</attach-sources-phase>
    <test-integration_report-phase>verify</test-integration_report-phase>
    <javascript-doc_copy-resources-phase>pre-site</javascript-doc_copy-resources-phase>

    <pentaho.resolve.repo>http://nexus.pentaho.org/content/groups/omni/</pentaho.resolve.repo>
    <!-- No default repository URL deployments, these must be defined at build-time -->
    <pentaho.public.release.repo />
    <pentaho.public.snapshot.repo />
    <pentaho.private.release.repo />
    <pentaho.private.snapshot.repo />

    <site.publish.url>http://nexus.pentaho.org/content/sites/public-site</site.publish.url>    
    <pentaho.staging.repo.root.url>http://10.177.178.195</pentaho.staging.repo.root.url>
    <nexus.staging.profile.id>0</nexus.staging.profile.id>
    <nexus.staging.server.id />
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <build.javascriptSourceDirectory>${basedir}/src/main/javascript</build.javascriptSourceDirectory>
    <build.javascriptOutputDirectory>${project.build.directory}/javascriptOutput</build.javascriptOutputDirectory>
    <build.transpiledJavascriptOutputDirectory>${project.build.directory}/transpiledJavascriptOutput</build.transpiledJavascriptOutputDirectory>
    <build.javascriptConfigDirectory>${basedir}/src/main/config/javascript</build.javascriptConfigDirectory>

    <build.javascriptTestSourceDirectory>${basedir}/src/test/javascript</build.javascriptTestSourceDirectory>
    <build.javascriptTestOutputDirectory>${project.build.directory}/test-javascript</build.javascriptTestOutputDirectory>
    <build.javascriptTestConfigDirectory>${basedir}/src/test/config/javascript</build.javascriptTestConfigDirectory>
	
    <jenkins.javascript-test_karma.reportsDirectory>${basedir}/target/js-reports</jenkins.javascript-test_karma.reportsDirectory>

    <build.dependenciesDirectory>${project.build.directory}/dependency</build.dependenciesDirectory>

    <pentaho-js-build.dir>${build.dependenciesDirectory}/pentaho-js-build</pentaho-js-build.dir>
    <rjs.webjar.file>${build.dependenciesDirectory}/META-INF/resources/webjars/rjs/${rjs.version}/bin/r.js</rjs.webjar.file>

    <requirejs.build.file>build.js</requirejs.build.file>
    <js.project.list>dummy</js.project.list>

    <!-- Set to true if javascript sources need to be transpiled (e.g.: if it uses es6) -->
    <js.transpile.project>false</js.transpile.project>

    <!-- Set to true if using sass for styling.project needs to be transpiled (e.g.: if it uses es6) -->
    <css.sass.project>false</css.sass.project>

    <docjs.config.file />

    <frontend-maven-plugin.workingDirectory>${project.rootdir}</frontend-maven-plugin.workingDirectory>
    <frontend-maven-plugin.installDirectory>${frontend-maven-plugin.workingDirectory}/target</frontend-maven-plugin.installDirectory>

    <!-- License Configuration -->
    <license.organizationName>Hitachi Vantara</license.organizationName>
    <license.inceptionYear>2002</license.inceptionYear>
    <license.licenseFile>LICENSE.txt</license.licenseFile>
    <license.bundleLicenseFile>META-INF/LICENSE.txt</license.bundleLicenseFile>
    <license.failOnLicenseCheck>false</license.failOnLicenseCheck>

    <!-- Chechstyle configuration -->
    <!--  configuration file comes from coding-standards artifact -->
    <checkstyle.configLocation>checkstyle/pentaho_checks.xml</checkstyle.configLocation>
    <checkstyle.consoleOutput>true</checkstyle.consoleOutput>
    <checkstyle.linkXRef>true</checkstyle.linkXRef>
    <pentaho-eula-wrap-config.version>8.1.0.0-SNAPSHOT</pentaho-eula-wrap-config.version>

    <!-- Documentation properties -->
    <!-- parsedVersion.* properties are dynamically created by the build-helper-maven-plugin:create-doc-version-property -->
    <doc.version>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}</doc.version>
    <doc.base.url>https://help.pentaho.com/Documentation/${doc.version}</doc.base.url>
  </properties>
 
  <distributionManagement>
    <repository>
      <id>pentaho.public.release.repo</id>
      <name>Pentaho Public Release Repository</name>
      <url>${pentaho.public.release.repo}</url>
    </repository>
    <snapshotRepository>
      <id>pentaho.public.snapshot.repo</id>
      <name>Pentaho Public Snapshot Repository</name>
      <url>${pentaho.public.snapshot.repo}</url>
    </snapshotRepository>
  </distributionManagement>

  <repositories>
    <repository>
      <id>pentaho-public</id>
      <name>Pentaho Resolve Repo</name>
      <url>${pentaho.resolve.repo}</url>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>daily</updatePolicy>
      </releases>
      <snapshots>
        <enabled>true</enabled>
        <updatePolicy>daily</updatePolicy>
      </snapshots>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>pentaho-public</id>
      <name>Pentaho Resolve Repo</name>
      <url>${pentaho.resolve.repo}</url>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>daily</updatePolicy>
      </releases>
      <snapshots>
        <enabled>true</enabled>
        <updatePolicy>daily</updatePolicy>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <version>${maven-bundle-plugin.version}</version>
          <extensions>true</extensions>
          <configuration>
            <instructions>
              <!-- Required for generic jar version checking -->
              <Implementation-Version>${project.version}</Implementation-Version>
            </instructions>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${maven-resources-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${jacoco-maven-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <version>${maven-source-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven-surefire-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-report-plugin</artifactId>
          <version>${maven-surefire-report-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${maven-failsafe-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>${maven-project-info-reports-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-jxr-plugin</artifactId>
          <version>${maven-jxr-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven-javadoc-plugin.version}</version>
        </plugin>

        <plugin>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>${maven-checkstyle-plugin.version}</version>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>${checkstyle.version}</version>
            </dependency>
            <dependency>
              <groupId>org.pentaho</groupId>
              <artifactId>coding-standards</artifactId>
              <version>${coding-standards.version}</version>
              <type>zip</type>
            </dependency>
          </dependencies>
          <configuration>
            <configLocation>${checkstyle.configLocation}</configLocation>
            <linkXRef>${checkstyle.linkXRef}</linkXRef>
            <consoleOutput>${checkstyle.consoleOutput}</consoleOutput>
            <cacheFile />
          </configuration>
        </plugin>

        <plugin>
          <groupId>com.github.spotbugs</groupId>
          <artifactId>spotbugs-maven-plugin</artifactId>
          <version>${spotbugs.version}</version>
          <configuration>
            <includeFilterFile>findbugs/pentaho_checks.xml</includeFilterFile>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>org.pentaho</groupId>
              <artifactId>coding-standards</artifactId>
              <version>${coding-standards.version}</version>
              <type>zip</type>
            </dependency>
          </dependencies>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>sonar-maven-plugin</artifactId>
          <version>${sonar-maven-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-verifier-plugin</artifactId>
          <version>${maven-verifier-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${maven-jar-plugin.version}</version>
          <configuration>
            <archive>
              <manifest>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
              </manifest>
              <manifestEntries>
                <Source-Java-Version>${source.jdk.version}</Source-Java-Version>
                <Target-Java-Version>${target.jdk.version}</Target-Java-Version>
                <Implementation-ProductID>${project.artifactId}</Implementation-ProductID>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven-compiler-plugin.version}</version>
          <configuration>
            <source>${source.jdk.version}</source>
            <target>${target.jdk.version}</target>
            <compilerArgument>${compilerArgument}</compilerArgument>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>${maven-clean-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>${maven-dependency-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>${maven-install-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${maven-deploy-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <version>${maven-release-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <version>${maven-site-plugin.version}</version>
          <dependencies>
            <dependency>
              <groupId>org.apache.maven.wagon</groupId>
              <artifactId>wagon-webdav-jackrabbit</artifactId>
              <version>2.10</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>${build-helper-maven-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>${maven-assembly-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>com.github.bringking</groupId>
          <artifactId>requirejs-maven-plugin</artifactId>
          <version>${requirejs-maven-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>com.github.eirslett</groupId>
          <artifactId>frontend-maven-plugin</artifactId>
          <version>${frontend-maven-plugin.version}</version>
          <configuration>
            <workingDirectory>${frontend-maven-plugin.workingDirectory}</workingDirectory>
            <installDirectory>${frontend-maven-plugin.installDirectory}</installDirectory>
            <nodeVersion>${nodejs.version}</nodeVersion>
            <npmVersion>${npm.version}</npmVersion>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>${maven-antrun-plugin.version}</version>
        </plugin>
        <plugin>
          <artifactId>maven-war-plugin</artifactId>
          <version>${maven-war-plugin.version}</version>
          <configuration>
            <failOnMissingWebXml>false</failOnMissingWebXml>
          </configuration>
        </plugin>
        <plugin>
          <groupId>com.soebes.maven.plugins</groupId>
          <artifactId>iterator-maven-plugin</artifactId>
          <version>${iterator-maven-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.pentaho.maven.plugins</groupId>
          <artifactId>license-helper-maven-plugin</artifactId>
          <version>${license-helper-maven-plugin.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>set-doc-version-property</id>
            <goals>
              <goal>parse-version</goal>
            </goals>
          </execution>
          <execution>
            <id>set-root-dir-property</id>
            <goals>
              <goal>rootlocation</goal>
            </goals>
            <configuration>
              <rootLocationProperty>project.rootdir</rootLocationProperty>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-site-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-site-descriptor</id>
            <goals>
              <goal>attach-descriptor</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.pentaho.maven.plugins</groupId>
        <artifactId>license-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>bundle-license</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>bundle</goal>
            </goals>
          </execution>
          <execution>
            <id>check-license</id>
            <phase>validate</phase>
            <goals>
              <goal>check-license</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>

  <profiles>
    <profile>
      <id>filtered-resources</id>
      <activation>
        <file>
          <exists>${basedir}/src/main/resources-filtered</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>add-filtered-resources</id>
                <goals>
                  <goal>add-resource</goal>
                </goals>
                <configuration>
                  <resources>
                    <resource>
                      <directory>src/main/resources-filtered</directory>
                      <filtering>true</filtering>
                    </resource>
                  </resources>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>clean-node-modules</id>
      <activation>
        <property>
          <name>!skipNodeClean</name>
        </property>
        <file>
          <exists>node_modules</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-clean-plugin</artifactId>
            <version>${maven-clean-plugin.version}</version>
            <configuration>
              <filesets>
                <fileset>
                  <directory>node_modules</directory>
                  <followSymlinks>false</followSymlinks>
                </fileset>
              </filesets>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>node-npm</id>
      <activation>
        <file>
          <exists>${basedir}/package.json</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.eirslett</groupId>
            <artifactId>frontend-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>node-npm_install</id>
                <phase>${node-npm_install-phase}</phase>
                <goals>
                  <goal>install-node-and-npm</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>javascript-dependencies</id>
      <activation>
        <property>
          <name>!skipDefault</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.soebes.maven.plugins</groupId>
            <artifactId>iterator-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>javascript-dependencies_unpack-dependencies</id>
                <phase>${javascript_unpack-dependencies-phase}</phase>
                <goals>
                  <goal>iterator</goal>
                </goals>
                <configuration>
                  <content>${js.project.list}</content>
                  <pluginExecutors>
                    <pluginExecutor>
                      <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                      </plugin>
                      <goal>unpack-dependencies</goal>
                      <configuration>
                        <includeArtifactIds>${item}</includeArtifactIds>
                        <includes>**/**</includes>
                      </configuration>
                    </pluginExecutor>
                  </pluginExecutors>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>override-pentaho-js-build</id>
      <activation>
        <file>
          <exists>${build.javascriptConfigDirectory}/profileBuilder.js</exists>
        </file>
      </activation>
      <properties>
        <dependency.pentaho-js-build.revision>1.0.0</dependency.pentaho-js-build.revision>
      </properties>
      <dependencies>
        <dependency>
          <groupId>pentaho</groupId>
          <artifactId>pentaho-js-build</artifactId>
          <version>${dependency.pentaho-js-build.revision}</version>
          <type>zip</type>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>override-pentaho-js-build_unpack-dependencies</id>
                <phase>${javascript_unpack-dependencies-phase}</phase>
                <goals>
                  <goal>unpack-dependencies</goal>
                </goals>
                <configuration>
                  <includeArtifactIds>pentaho-js-build</includeArtifactIds>
                  <includes>**/**</includes>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <executions>
              <execution>
                <id>override-pentaho-js-build_override-profilebuilder</id>
                <phase>${javascript_override-profilebuilder-phase}</phase>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
                <configuration>
                  <outputDirectory>${pentaho-js-build.dir}</outputDirectory>
                  <resources>
                    <resource>
                      <directory>${build.javascriptConfigDirectory}</directory>
                      <filtering>true</filtering>
                      <includes>
                        <include>profileBuilder.js</include>
                      </includes>
                    </resource>
                  </resources>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>javascript-requirecfg</id>
      <activation>
        <file>
          <exists>${build.javascriptConfigDirectory}/context.js</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>javascript-requirecfg_aggregate</id>
                <phase>${javascript-requirecfg_aggregate-phase}</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <target>
                    <concat destfile="${project.build.directory}/requireCfg.js" force="yes" append="true">
                      <file file="${build.javascriptConfigDirectory}/context.js" />
                      <fileset casesensitive="yes" dir="${build.dependenciesDirectory}">
                        <include name="${requirejs.config.files.pattern}" />
                      </fileset>
                    </concat>
                    <path id="build.classpath">
                      <fileset dir="${pentaho-js-build.dir}/libs">
                        <include name="*.jar" />
                      </fileset>
                    </path>
                    <java fork="true" classname="org.mozilla.javascript.tools.shell.Main" classpathref="build.classpath">
                      <arg value="${pentaho-js-build.dir}/profileBuilder.js" />
                    </java>
                  </target>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>javascript-bundle</id>
      <activation>
        <file>
          <exists>${build.javascriptConfigDirectory}/${requirejs.build.file}</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.eirslett</groupId>
            <artifactId>frontend-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>node-npm_install</id>
                <phase>${node-npm_install-phase}</phase>
                <goals>
                  <goal>install-node-and-npm</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>com.github.bringking</groupId>
            <artifactId>requirejs-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>javascript-bundle_optimize</id>
                <phase>${javascript_optimize-phase}</phase>
                <goals>
                  <goal>optimize</goal>
                </goals>
                <configuration>
                  <nodeExecutable>${frontend-maven-plugin.installDirectory}/node/node</nodeExecutable>
                  <configFile>${build.javascriptConfigDirectory}/${requirejs.build.file}</configFile>
                  <optimizerFile>${pentaho-js-build.dir}/r.js</optimizerFile>
                  <filterConfig>true</filterConfig>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>javascript-test</id>
      <activation>
        <property>
          <name>!maven.test.skip</name>
        </property>
        <file>
          <exists>${build.javascriptTestSourceDirectory}</exists>
        </file>
      </activation>
      <properties>
        <karma.file.config>karma.ci.conf.js</karma.file.config>
      </properties>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <executions>
              <execution>
                <id>javascript-test_copy-resources</id>
                <phase>${javascript-test_copy-resources-phase}</phase>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
                <configuration>
                  <outputDirectory>${project.build.directory}/test-javascript</outputDirectory>
                  <resources>
                    <resource>
                      <directory>${build.javascriptSourceDirectory}</directory>
                    </resource>
                  </resources>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>com.github.eirslett</groupId>
            <artifactId>frontend-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>node-npm_install</id>
                <phase>${node-npm_install-phase}</phase>
                <goals>
                  <goal>install-node-and-npm</goal>
                </goals>
              </execution>
              <execution>
                <id>javascript-test_npm-install</id>
                <phase>${javascript-test_npm-install-phase}</phase>
                <goals>
                  <goal>npm</goal>
                </goals>
                <configuration>
                  <arguments>install</arguments>
                  <workingDirectory>${frontend-maven-plugin.installDirectory}</workingDirectory>
                </configuration>
              </execution>
              <execution>
                <id>javascript-test_karma</id>
                <phase>${javascript-test_karma-phase}</phase>
                <goals>
                  <goal>karma</goal>
                </goals>
                <configuration>
                  <karmaConfPath>${build.javascriptTestConfigDirectory}/${karma.file.config}</karmaConfPath>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>javascript-doc</id>
      <activation>
        <property>
          <name>!maven.jsdoc.skip</name>
        </property>
        <file>
          <exists>${basedir}/src/doc/javascript/config/${docjs.config.file}</exists>
        </file>
      </activation>
      <properties>
        <jsdoc3-maven-plugin.version>1.2.0</jsdoc3-maven-plugin.version>
        <docjs.config.includePrivate>false</docjs.config.includePrivate>
      </properties>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>com.phasebash.jsdoc</groupId>
              <artifactId>jsdoc3-maven-plugin</artifactId>
              <version>${jsdoc3-maven-plugin.version}</version>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <executions>
              <execution>
                <id>javascript-doc_copy-resources</id>
                <phase>${javascript-doc_copy-resources-phase}</phase>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
                <configuration>
                  <overwrite>true</overwrite>
                  <outputDirectory>${project.build.directory}</outputDirectory>
                  <resources>
                    <resource>
                      <directory>${basedir}/src/doc/javascript/config</directory>
                      <filtering>true</filtering>
                    </resource>
                  </resources>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <reporting>
        <plugins>
          <plugin>
            <groupId>com.phasebash.jsdoc</groupId>
            <artifactId>jsdoc3-maven-plugin</artifactId>
            <configuration>
              <configFile>${project.build.directory}/${docjs.config.file}</configFile>
              <includePrivate>${docjs.config.includePrivate}</includePrivate>
              <!--
                 The jsdoc3 maven plugin requires the directoryRoots or sourceFiles defined
                 as a work around we are defining the source file as the config file to enable
                 the plugin and don't cause side effects on upstream projects configuration files
              -->
              <sourceFiles>
                <sourceFile>${project.build.directory}/${docjs.config.file}</sourceFile>
              </sourceFiles>
            </configuration>
          </plugin>
        </plugins>
      </reporting>
    </profile>

    <profile>
      <id>assembly</id>
      <activation>
        <file>
          <exists>${basedir}/src/assembly/assembly.xml</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
              <execution>
                <id>assembly_package</id>
                <phase>${assembly_package-phase}</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <descriptorSourceDirectory>${basedir}/src/assembly</descriptorSourceDirectory>
                  <appendAssemblyId>${assembly_appendId}</appendAssemblyId>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>eula-wrap</id>
      <activation>
        <property>
          <name>eula-wrap</name>
        </property>
      </activation>
      <properties>
        <artifactName>${project.artifactId}-${project.version}</artifactName>
        <izpack-maven-plugin.version>5.0.7-RC1</izpack-maven-plugin.version>
      </properties>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>eula-wrap_assign-deps-to-properties</id>
                <phase>${eula-wrap_assign-deps-to-properties-phase}</phase>
                <goals>
                  <goal>properties</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.izpack</groupId>
            <artifactId>izpack-maven-plugin</artifactId>
            <version>${izpack-maven-plugin.version}</version>
            <executions>
              <execution>
                <id>eula-wrap_create-izpack-installer-jar</id>
                <phase>${eula-wrap_create-izpack-installer-jar-phase}</phase>
                <goals>
                  <goal>izpack</goal>
                </goals>
                <configuration>
                  <baseDir>${project.build.directory}</baseDir>
                  <kind>standard</kind>
                  <installFile>${pentaho:pentaho-eula-wrap-config:xml:izpack-zip}</installFile>
                  <finalName>installer</finalName>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>eula-wrap_create-dist</id>
                <phase>${eula-wrap_create-dist-phase}</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <target>
                    <zip destfile="${project.build.directory}/${project.artifactId}-${project.version}-dist.zip" preserve0permissions="true">
                      <zipfileset file="${pentaho:pentaho-eula-wrap-config:txt:README}" fullpath="${artifactName}/README.txt" />
                      <zipfileset file="${pentaho:pentaho-eula-wrap-config:bat:install}" fullpath="${artifactName}/install.bat" />
                      <zipfileset file="${pentaho:pentaho-eula-wrap-config:sh:install}" fullpath="${artifactName}/install.sh" filemode="755" />
                      <zipfileset file="${pentaho:pentaho-eula-wrap-config:txt:eula}" fullpath="${artifactName}/license.txt" />
                      <zipfileset fullpath="${artifactName}/installer.jar" includes="installer.jar" dir="${project.build.directory}" />
                    </zip>
                    <delete file="${project.build.directory}/installer.jar" />
                  </target>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>eula-wrap_attach-dist</id>
                <phase>${eula-wrap_attach-dist-phase}</phase>
                <goals>
                  <goal>attach-artifact</goal>
                </goals>
                <configuration>
                  <artifacts>
                    <artifact>
                      <file>${project.build.directory}/${project.artifactId}-${project.version}-dist.zip</file>
                      <classifier>dist</classifier>
                      <type>zip</type>
                    </artifact>
                  </artifacts>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <dependencies>
        <dependency>
          <groupId>pentaho</groupId>
          <artifactId>pentaho-eula-wrap-config</artifactId>
          <version>${pentaho-eula-wrap-config.version}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>pentaho</groupId>
          <artifactId>pentaho-eula-wrap-config</artifactId>
          <version>${pentaho-eula-wrap-config.version}</version>
          <type>xml</type>
          <classifier>izpack-zip</classifier>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>pentaho</groupId>
          <artifactId>pentaho-eula-wrap-config</artifactId>
          <version>${pentaho-eula-wrap-config.version}</version>
          <type>bat</type>
          <classifier>install</classifier>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>pentaho</groupId>
          <artifactId>pentaho-eula-wrap-config</artifactId>
          <version>${pentaho-eula-wrap-config.version}</version>
          <type>sh</type>
          <classifier>install</classifier>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>pentaho</groupId>
          <artifactId>pentaho-eula-wrap-config</artifactId>
          <version>${pentaho-eula-wrap-config.version}</version>
          <type>txt</type>
          <classifier>README</classifier>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>pentaho</groupId>
          <artifactId>pentaho-eula-wrap-config</artifactId>
          <version>${pentaho-eula-wrap-config.version}</version>
          <type>txt</type>
          <classifier>eula</classifier>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>pentaho</groupId>
          <artifactId>pentaho-eula-wrap-config</artifactId>
          <version>${pentaho-eula-wrap-config.version}</version>
          <type>html</type>
          <classifier>eula</classifier>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>pentaho</groupId>
          <artifactId>pentaho-eula-wrap-config</artifactId>
          <version>${pentaho-eula-wrap-config.version}</version>
          <type>png</type>
          <classifier>izpack-sidebar</classifier>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
    
    <profile>
      <id>sonatype</id>
      <activation>
        <property>
          <name>sonatype</name>
        </property>
      </activation>
      <distributionManagement>
        <repository>
          <id>sonatype.staging.repo</id>
          <name>Maven Central Release Staging</name>
          <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
        <snapshotRepository>
          <id>sonatype.snapshot.repo</id>
          <name>Sonatype Snapshots</name>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
      </distributionManagement>
      <build>
        <plugins>
          <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>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>audit</id>
      <activation>
        <property>
          <name>audit</name>
        </property>
      </activation>
      <properties>
        <checkstyle.consoleOutput>false</checkstyle.consoleOutput>
        <checkstyle.linkXRef>false</checkstyle.linkXRef>
        <test-unit-jacoco-agent-prep-phase>initialize</test-unit-jacoco-agent-prep-phase>
        <test-unit-jacoco-report-phase>verify</test-unit-jacoco-report-phase>
        <!-- disabled by default, will be enabled if runITs -->
        <test-integration_jacoco-agent-prep-phase />
        <test-integration_jacoco-report-phase />
      </properties>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <executions>
              <execution>
                <id>checkstyle</id>
                <phase>validate</phase>
                <goals>
                  <goal>checkstyle</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>test-unit-jacoco-agent-prep</id>
                <phase>${test-unit-jacoco-agent-prep-phase}</phase>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
                <configuration>
                  <propertyName>jacocoSurefireArgLine</propertyName>
                </configuration>
              </execution>
              <execution>
                <id>test-unit-jacoco-report</id>
                <phase>${test-unit-jacoco-report-phase}</phase>
                <goals>
                  <goal>report</goal>
                </goals>
              </execution>
              <!-- integration tests -->
              <execution>
                <id>test-integration_jacoco-agent-prep</id>
                <phase>${test-integration_jacoco-agent-prep-phase}</phase>
                <goals>
                  <goal>prepare-agent-integration</goal>
                </goals>
                <configuration>
                  <propertyName>jacocoFailsafeArgLine</propertyName>
                </configuration>
              </execution>
              <execution>
                <id>test-integration_jacoco-report</id>
                <phase>${test-integration_jacoco-report-phase}</phase>
                <goals>
                  <goal>report-integration</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>spotbugs</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.spotbugs</groupId>
            <artifactId>spotbugs-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>spotbugs-check</id>
                <phase>verify</phase>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>reporting</id>
      <activation>
        <property>
          <name>!maven.test.skip</name>
        </property>
      </activation>
      <reporting>
        <plugins>
          <plugin>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <configuration>
              <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-jxr-plugin</artifactId>
            <reportSets>
              <reportSet>
                <id>jxr</id>
                <reports>
                  <report>jxr</report>
                </reports>
              </reportSet>
            </reportSets>
            <configuration>
              <linkJavadoc>true</linkJavadoc>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <reportSets>
              <reportSet>
                <id>javadoc</id>
                <reports>
                  <report>javadoc</report>
                </reports>
              </reportSet>
            </reportSets>
            <configuration>
              <failOnError>false</failOnError>
            </configuration>
          </plugin>
            <plugin>
              <artifactId>maven-checkstyle-plugin</artifactId>
              <reportSets>
                <reportSet>
                  <id>checkstyle</id>
                  <reports>
                    <report>checkstyle</report>
                  </reports>
                </reportSet>
              </reportSets>
              <configuration>
                <consoleOutput>false</consoleOutput>
                <linkXRef>true</linkXRef>
              </configuration>
            </plugin>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
          </plugin>
          <plugin>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <reportSets>
              <reportSet>
                <id>unit-tests</id>
                <reports>
                  <report>report-only</report>
                </reports>
              </reportSet>
              <reportSet>
                <id>integration-tests</id>
                <reports>
                  <report>failsafe-report-only</report>
                </reports>
              </reportSet>
            </reportSets>
            <configuration>
              <linkXRef>true</linkXRef>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-site-plugin</artifactId>
          </plugin>
        </plugins>
      </reporting>
    </profile>
   <!-- Support Nexus Staging Deployment -->
   <profile>
   <id>deploy-to-staging</id>
    <build>
      <plugins>      
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>1.6.8</version>
          <extensions>true</extensions>
          <configuration>
            <nexusUrl>${pentaho.staging.repo.root.url}</nexusUrl>
            <serverId>${nexus.staging.server.id}</serverId>
            <stagingProfileId>${nexus.staging.profile.id}</stagingProfileId>
          </configuration>
        </plugin>
      </plugins>      
    </build>
    </profile>  
  </profiles>
</project>
