<?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/maven-v4_0_0.xsd">
  <parent>
    <groupId>io.hawt</groupId>
    <artifactId>project</artifactId>
    <version>1.4.0.redhat-630283-10</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <artifactId>hawtio-web</artifactId>
  <packaging>war</packaging>
  <name>${project.artifactId}</name>
  <description>hawtio :: hawtio-web</description>

  <properties>
    <!-- when not doing a release lets use a dummy version number to test out the replacement in the manifest.json -->
    <chrome-version>1.0.1</chrome-version>
    <!--
    <phantomjs-executable>/usr/local/bin/phantomjs</phantomjs-executable>
    -->
    <appjs-outfile>${basedir}/src/main/webapp/app/app.js</appjs-outfile>
    <watch>false</watch>
    <gruntArguments>default</gruntArguments>
    <gruntOptions />
    <gruntE2EArguments>e2e</gruntE2EArguments>
    <gruntE2EOptions>--headless</gruntE2EOptions>
    <warSourceDirectory>${basedir}/src/main/webapp</warSourceDirectory>
    <webappDirectory>${webapp-outdir}</webappDirectory>
    <warSourceExcludes>**</warSourceExcludes>
    <packagingExcludes>**/classes/OSGI-INF/**,*/debug/**</packagingExcludes>
    <packagingIncludes />

    <hawtio-config-importURLs />
    <hawtio-config-cloneOnStartup>true</hawtio-config-cloneOnStartup>
    <fabricUrl />
    <jetty-use-file-lock />
  </properties>

  <dependencies>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>${servlet-api-version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.jolokia</groupId>
      <artifactId>jolokia-core</artifactId>
      <version>${jolokia-version}</version>
    </dependency>

    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-core</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-system</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${guava-version}</version>
    </dependency>

    <!-- Git module -->
    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-git</artifactId>
      <version>${project.version}</version>
    </dependency>

    <!-- testing -->
    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-junit</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-kubernetes</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-maven-indexer</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-json-schema-mbean</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-local-jvm-mbean</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-keystore-mbean</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-aether</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-dozer</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.hawt.example.services</groupId>
      <artifactId>example-dozer-models</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.hawt.example.services</groupId>
      <artifactId>example-infinispan</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit-version}</version>
      <scope>test</scope>
    </dependency>
    <!--<dependency>-->
      <!--<groupId>org.eclipse.jetty.aggregate</groupId>-->
      <!--<artifactId>${jetty-webapp-artifactId}</artifactId>-->
      <!--<version>${jetty-version}</version>-->
      <!--<scope>test</scope>-->
      <!--<exclusions>-->
        <!--<exclusion>-->
          <!--<groupId>org.eclipse.jetty.orbit</groupId>-->
          <!--<artifactId>javax.servlet</artifactId>-->
        <!--</exclusion>-->
      <!--</exclusions>-->
    <!--</dependency>-->
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-annotations</artifactId>
      <version>${jetty-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-plus</artifactId>
      <version>${jetty-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-jmx</artifactId>
      <version>${jetty-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-util</artifactId>
      <version>${jetty-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>${jetty-plugin-groupId}</groupId>
      <artifactId>jetty-maven-plugin</artifactId>
      <version>${jetty-version}</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.eclipse.jetty.orbit</groupId>
          <artifactId>javax.servlet</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.eclipse.jetty</groupId>
          <artifactId>apache-jsp</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- for some sample stuff to browse -->
    <dependency>
      <groupId>org.apache.aries.blueprint</groupId>
      <artifactId>org.apache.aries.blueprint.web</artifactId>
      <version>${blueprint-web-version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-core</artifactId>
      <version>${camel-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-catalog</artifactId>
      <version>${camel-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-jms</artifactId>
      <version>${camel-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-spring</artifactId>
      <version>${camel-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-blueprint</artifactId>
      <version>${camel-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-jackson</artifactId>
      <version>${camel-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-jetty</artifactId>
      <version>${camel-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-metrics</artifactId>
      <version>${camel-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-quartz2</artifactId>
      <version>${camel-version}</version>
      <scope>test</scope>
    </dependency>
    <!--dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-all</artifactId>
      <version>${activemq-version}</version>
      <scope>test</scope>
    </dependency-->
    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-jaas</artifactId>
      <version>${activemq-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-camel</artifactId>
      <version>${activemq-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.xbean</groupId>
      <artifactId>xbean-spring</artifactId>
      <version>${xbean-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <version>${spring-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
      <version>${spring-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
      <version>${spring-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
      <version>${spring-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.fabric8.insight</groupId>
      <artifactId>insight-log4j</artifactId>
      <version>${insight-log4j-version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.eclipse.jgit</groupId>
      <artifactId>org.eclipse.jgit</artifactId>
      <version>${jgit-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.fabric8</groupId>
      <artifactId>gitective-core</artifactId>
      <version>${gitective-version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>net.alchim31</groupId>
      <artifactId>livereload-jvm</artifactId>
      <version>0.2.0</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>false</filtering>
      </testResource>
      <testResource>
        <directory>src/test/resources-filtered</directory>
        <filtering>true</filtering>
      </testResource>
    </testResources>
    <pluginManagement>
      <plugins>
        <plugin>
          <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-antrun-plugin</artifactId>
                    <versionRange>[1.0,)</versionRange>
                    <goals>
                      <goal>run</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <execute>
                      <runOnIncremental>false</runOnIncremental>
                      <runOnConfiguration>true</runOnConfiguration>
                    </execute>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>io.hawt</groupId>
                    <artifactId>hawtio-json-schema-generator-plugin</artifactId>
                    <versionRange>[${project.version},)</versionRange>
                    <goals>
                      <goal>generate-json-schema</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <execute>
                      <runOnIncremental>false</runOnIncremental>
                      <runOnConfiguration>true</runOnConfiguration>
                    </execute>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <versionRange>[1.0,)</versionRange>
                    <goals>
                      <goal>exec</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <execute>
                      <runOnIncremental>false</runOnIncremental>
                      <runOnConfiguration>true</runOnConfiguration>
                    </execute>
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <filesets>
            <fileset>
              <directory>${basedir}/src/main/webapp/bower_components</directory>
            </fileset>
            <fileset>
              <directory>${basedir}/src/main/webapp/app</directory>
              <includes>
                <include>app.js</include>
                <include>app.min.js</include>
                <include>*.map</include>
              </includes>
            </fileset>
            <fileset>
              <directory>${basedir}/dist</directory>
            </fileset>
            <fileset>
              <directory>${basedir}/.tmp</directory>
            </fileset>
            <fileset>
              <directory>${basedir}/tmp</directory>
            </fileset>
          </filesets>
        </configuration>
      </plugin>

      <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <version>${frontend-maven-plugin-version}</version>
        <executions>
          <execution>
            <id>install node and npm</id>
            <goals>
              <goal>install-node-and-npm</goal>
            </goals>
            <phase>generate-resources</phase>
            <configuration>
              <nodeVersion>v0.10.32</nodeVersion>
              <npmVersion>1.4.12</npmVersion>
            </configuration>
          </execution>
          <execution>
            <id>npm install</id>
            <goals>
              <goal>npm</goal>
            </goals>
            <configuration>
              <arguments>install</arguments>
            </configuration>
          </execution>
          <execution>
            <id>grunt build</id>
            <goals>
              <goal>grunt</goal>
            </goals>
            <configuration>
              <arguments>${gruntArguments} ${gruntOptions}</arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <!-- skip dummy tests -->
          <excludes>
            <exclude>io/hawt/dummy/*.java</exclude>
          </excludes>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>${maven-antrun-plugin-version}</version>
        <executions>
          <execution>
            <id>process-resources</id>
            <phase>process-resources</phase>
            <configuration>
              <target>
                <mkdir dir="${project.build.outputDirectory}" />

                <echo>Writing version to index.html</echo>
                <copy tofile="${webappDirectory}/index.html" file="${warSourceDirectory}/index.html" overwrite="true" />

                <echo>Coping help files to site</echo>
                <copy todir="${webappDirectory}/app/site" overwrite="true">
                  <fileset dir="${basedir}/..">
                    <include name="*.md" />
                  </fileset>
                </copy>

                <echo>Copying site documentation</echo>
                <copy todir="${webappDirectory}/app/site/doc" overwrite="true">
                  <fileset dir="${basedir}/../docs">
                    <include name="**/*.md" />
                    <include name="**/*.html" />
                    <include name="images/*.*" />
                  </fileset>
                </copy>

                <echo>Copying base directory docs</echo>
                <copy todir="${webappDirectory}/app/core/doc">
                  <fileset dir="${basedir}/..">
                    <include name="*.md" />
                  </fileset>
                </copy>

                <echo>Copying static non-ts resources to exploded war directory</echo>
                <copy todir="${webappDirectory}">
                  <fileset dir="${warSourceDirectory}">
                    <include name="**" />
                    <exclude name="manifest.json" />
                    <exclude name="app/*/js/**" />
                    <exclude name="app/*/js" />
                    <!-- sorry, couldn't do it better for now -->
                    <exclude name="bower_components/Font-Awesome/less/**" />
                    <exclude name="bower_components/Font-Awesome/scss/**" />
                    <exclude name="bower_components/Font-Awesome/src/**" />
                    <exclude name="bower_components/bootstrap/docs/build/**" />
                    <exclude name="bower_components/bootstrap/docs/examples/**" />
                    <exclude name="bower_components/bootstrap/docs/assets/img/example-sites/**" />
                    <exclude name="bower_components/bootstrap/docs/assets/img/examples/**" />
                    <exclude name="bower_components/bootstrap/less/**" />
                    <exclude name="bower_components/d3/lib/**" />
                    <exclude name="bower_components/d3/src/**" />
                    <exclude name="bower_components/d3/test/**" />
                    <exclude name="bower_components/d3/d3.js" />
                    <exclude name="bower_components/d3/*.json" />
                    <exclude name="bower_components/elastic.js/examples/**" />
                    <exclude name="bower_components/elastic.js/src/**" />
                    <exclude name="bower_components/elastic.js/tests/**" />
                    <exclude name="bower_components/elastic.js/dist/elastic.js" />
                    <exclude name="bower_components/jquery/build/**" />
                    <exclude name="bower_components/jquery/speed/**" />
                    <exclude name="bower_components/jquery/src/**" />
                    <exclude name="bower_components/jquery/test/**" />
                    <!-- / -->
                  </fileset>
                </copy>

                <!-- update the manifest version -->
                <copy todir="${webappDirectory}">
                  <filterset begintoken="version&quot;: &quot;" endtoken="&quot;">
                    <filter token="1.0.0" value="version&quot;: &quot;${chrome-version}&quot;" />
                  </filterset>
                  <fileset dir="${basedir}/src/main/webapp">
                    <include name="manifest.json" />
                  </fileset>
                </copy>

              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>${maven-bundle-plugin-version}</version>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <supportedProjectTypes>
            <supportedProjectType>war</supportedProjectType>
          </supportedProjectTypes>
          <instructions>
            <Webapp-Context>${context}</Webapp-Context>
            <Web-ContextPath>${context}</Web-ContextPath>

            <Embed-Directory>WEB-INF/lib</Embed-Directory>
            <Embed-Dependency>*;scope=compile|runtime;artifactId=!org.osgi.enterprise|org.osgi.core</Embed-Dependency>
            <Embed-Transitive>true</Embed-Transitive>

            <!-- fix jgit, and slf4j imports -->
            <Import-Package>
              io.hawt.git;resolution:=optional;version="[1.4,2)",
              io.hawt.util;resolution:=optional;version="[1.4,2)",
              io.hawt.util.introspect;resolution:=optional;version="[1.4,2)",
              io.hawt.util.introspect.support;resolution:=optional;version="[1.4,2)",
              org.osgi.framework,
              org.osgi.util.tracker,
              org.eclipse.jetty.plus.jaas.spi;resolution:=optional,
              org.eclipse.jetty.plus.jaas.callback;resolution:=optional,
              org.apache.commons.logging;resolution:=optional,
              org.slf4j;resolution:=optional,
              org.apache.karaf.jaas.boot.principal;resolution:=optional,
              !org.slf4j.impl,
              !org.apache.avalon*,
              !org.apache.log*,
              !javax.persistence,
              !com.jcraft.jzlib,
              !keypairgen,
              !signature,
              !userauth,
              !com.ibm.uvm.tools*,!com.sun.jdmk.comm*,!javax.jmdns*,!javax.jms*,!javax.portlet*,
              !org.apache.commons.io*,
              !com.google.errorprone.annotations.concurrent,
              *
            </Import-Package>
            <Private-Package></Private-Package>

            <Bundle-ClassPath>.</Bundle-ClassPath>
            <Bundle-Name>${project.description}</Bundle-Name>
            <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
            <Implementation-Title>hawtio osgi</Implementation-Title>
            <Implementation-Version>${project.version}</Implementation-Version>
          </instructions>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>${war-plugin-version}</version>
        <configuration>
          <outputFileNameMapping>@{artifactId}@-@{baseVersion}@@{dashClassifier?}@.@{extension}@</outputFileNameMapping>
          <warSourceDirectory>${warSourceDirectory}</warSourceDirectory>
          <webappDirectory>${webappDirectory}</webappDirectory>
          <packagingExcludes>${packagingExcludes}</packagingExcludes>
          <packagingIncludes>${packagingIncludes}</packagingIncludes>
          <warSourceExcludes>${warSourceExcludes}</warSourceExcludes>
          <failOnMissingWebXml>true</failOnMissingWebXml>
          <!--
                    TODO disabled using archiveClasses for https://github.com/hawtio/hawtio/issues/403
                    until we can figure out how to get the war to work inside OSGi again

                    <archiveClasses>true</archiveClasses>
          -->
          <archive>
            <manifestFile>${basedir}/target/classes/META-INF/MANIFEST.MF</manifestFile>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <groupId>io.hawt</groupId>
        <artifactId>hawtio-json-schema-generator-plugin</artifactId>
        <version>${project.version}</version>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>generate-json-schema</goal>
              <goal>generate-camel-model</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <classes>
            <io.hawt.dozer.schema.Mappings>
              ${schema-outdir}/dozerMappings.js
            </io.hawt.dozer.schema.Mappings>
            <io.hawt.dozer.schema.Mapping>
              ${schema-outdir}/dozerMapping.js
            </io.hawt.dozer.schema.Mapping>
            <io.hawt.dozer.schema.Field>
              ${schema-outdir}/dozerField.js
            </io.hawt.dozer.schema.Field>
            <io.hawt.dozer.schema.FieldExclude>
              ${schema-outdir}/dozerFieldExclude.js
            </io.hawt.dozer.schema.FieldExclude>
          </classes>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>io.hawt</groupId>
            <artifactId>hawtio-dozer-schemagen</artifactId>
            <version>${project.version}</version>
          </dependency>
        </dependencies>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>${build-helper-maven-plugin-version}</version>
        <executions>
          <execution>
            <id>attach-artifacts</id>
            <phase>package</phase>
            <goals>
              <goal>attach-artifact</goal>
            </goals>
            <configuration>
              <artifacts>
                <artifact>
                  <file>target/hawtio.d.ts</file>
                  <type>d.ts</type>
                </artifact>
              </artifacts>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>${jetty-plugin-groupId}</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>${jetty-plugin-version}</version>
        <configuration>
          <webAppConfig>
            <contextPath>${context}</contextPath>
            <baseResource implementation="org.eclipse.jetty.util.resource.ResourceCollection">
              <resourcesAsCSV>${warSourceDirectory},${webappDirectory}</resourcesAsCSV>
            </baseResource>
          </webAppConfig>
          <scanIntervalSeconds>0</scanIntervalSeconds>
          <stopKey>foo</stopKey>
          <stopPort>9999</stopPort>
          <useTestScope>true</useTestScope>
          <systemProperties>
            <systemProperty>
              <key>hawtio.config.dir</key>
              <value>${hawtio-config-dir}</value>
            </systemProperty>
            <systemProperty>
              <key>hawtio.config.repo</key>
              <value>${hawtio-config-repo}</value>
            </systemProperty>
            <systemProperty>
              <key>hawtio.config.importURLs</key>
              <value>${hawtio-config-importURLs}</value>
            </systemProperty>
            <systemProperty>
              <key>hawtio.config.cloneOnStartup</key>
              <value>${hawtio-config-cloneOnStartup}</value>
            </systemProperty>
            <systemProperty>
              <key>karaf.data</key>
              <value>${project.build.directory}/karaf-data</value>
            </systemProperty>
            <systemProperty>
              <key>hawtio.forceProperties</key>
              <value>true</value>
            </systemProperty>
            <systemProperty>
              <key>hawtio.authenticationEnabled</key>
              <value>false</value>
            </systemProperty>
            <systemProperty>
              <key>hawtio.forceBranding</key>
              <value>true</value>
            </systemProperty>
            <systemProperty>
              <key>java.security.auth.login.config</key>
              <value>${project.build.testOutputDirectory}/login.conf</value>
            </systemProperty>
          </systemProperties>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.0</version>
        <configuration>
          <port>9090</port>
          <path>/hawtio</path>
          <systemProperties>
          </systemProperties>
          <useTestClasspath>false</useTestClasspath>
          <warSourceDirectory>${warSourceDirectory}</warSourceDirectory>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat6-maven-plugin</artifactId>
        <version>2.0</version>
        <configuration>
          <port>9090</port>
          <path>/hawtio</path>
          <systemProperties>
            <systemProperty>
              <key>hawtio.authenticationEnabled</key>
              <value>false</value>
            </systemProperty>
          </systemProperties>
          <useTestClasspath>false</useTestClasspath>
          <warSourceDirectory>${warSourceDirectory}</warSourceDirectory>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.jboss.as.plugins</groupId>
        <artifactId>jboss-as-maven-plugin</artifactId>
        <version>7.3.Final</version>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>${exec-maven-plugin-version}</version>
        <executions>
          <execution>
            <goals>
              <goal>java</goal>
            </goals>
            <!--
                        <phase>test-compile</phase>
            -->
          </execution>
        </executions>
        <configuration>
          <mainClass>io.hawt.sample.Main</mainClass>
          <classpathScope>test</classpathScope>

          <systemProperties>
            <systemProperty>
              <key>basedir</key>
              <value>${basedir}</value>
            </systemProperty>
            <systemProperty>
              <key>fabricUrl</key>
              <value>${fabricUrl}</value>
            </systemProperty>
            <systemProperty>
              <key>jettyPort</key>
              <value>${jettyPort}</value>
            </systemProperty>
            <systemProperty>
              <key>context</key>
              <value>${context}</value>
            </systemProperty>
            <systemProperty>
              <key>webapp-outdir</key>
              <value>${webapp-outdir}</value>
            </systemProperty>
            <systemProperty>
              <key>hawtio.config.dir</key>
              <value>${hawtio-config-dir}</value>
            </systemProperty>
            <systemProperty>
              <key>jettyUseFileLock</key>
              <value>${jetty-use-file-lock}</value>
            </systemProperty>
            <systemProperty>
              <key>karaf.data</key>
              <value>${project.build.directory}/karaf-data</value>
            </systemProperty>
            <systemProperty>
              <key>hawtio.authenticationEnabled</key>
              <value>false</value>
            </systemProperty>
            <systemProperty>
              <key>hawtio.proxyDisableCertificateValidation</key>
              <value>true</value>
            </systemProperty>
          </systemProperties>
        </configuration>
      </plugin>

    </plugins>
  </build>

  <profiles>

    <profile>
      <id>watch</id>
      <properties>
        <appjs-outfile>${basedir}/src/main/webapp/app/app.js</appjs-outfile>
        <gruntArguments>bower watch</gruntArguments>
      </properties>
    </profile>

    <profile>
      <id>Windows</id>
      <activation>
        <os>
          <family>Windows</family>
        </os>
      </activation>
      <properties>
        <tsc-executable>tsc.cmd</tsc-executable>
        <!--
        <phantomjs-executable>phantomjs.cmd</phantomjs-executable>
        -->
        <jetty-use-file-lock>false</jetty-use-file-lock>
      </properties>
    </profile>

    <profile>
      <id>tomcat</id>
      <dependencies>
        <dependency>
          <groupId>org.atmosphere</groupId>
          <artifactId>atmosphere-runtime</artifactId>
          <version>${atmosphere-version}</version>
          <exclusions>
            <exclusion>
              <groupId>org.atmosphere</groupId>
              <artifactId>atmosphere-compat-tomcat</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1.1</version>
            <configuration>
              <packagingExcludes>WEB-INF/context.xml,META-INF/context.xml</packagingExcludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>watcher</id>
      <dependencies>
        <dependency>
          <groupId>io.hawt</groupId>
          <artifactId>hawtio-watcher-spring-context</artifactId>
          <version>${project.version}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>io.hawt</groupId>
          <artifactId>hawtio-watcher-blueprint-web</artifactId>
          <version>${project.version}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>io.hawt</groupId>
          <artifactId>hawtio-watcher-dynamic-jaxb</artifactId>
          <version>${project.version}</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>jbossweb</id>
      <dependencies>
        <dependency>
          <groupId>org.atmosphere</groupId>
          <artifactId>atmosphere-runtime</artifactId>
          <version>${atmosphere-version}</version>
          <exclusions>
            <exclusion>
              <groupId>org.atmosphere</groupId>
              <artifactId>atmosphere-compat-jbossweb</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1.1</version>
            <configuration>
              <packagingExcludes>WEB-INF/context.xml,META-INF/context.xml</packagingExcludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>icons</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <phase>generate-sources</phase>
                <configuration>
                  <target>
                    <!-- copy the images from the eclipse plugin -->
                    <copy todir="${basedir}/src/main/webapp/img/camel" overwrite="true">
                      <fileset dir="${basedir}/../../../fuseide/plugins/org.fusesource.ide.camel.model/icons">
                        <include name="*24.png" />
                        <include name="*15.png" />
                      </fileset>
                    </copy>
                  </target>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>amq57</id>
      <properties>
        <activemq-version>5.7.0.fuse-71-047</activemq-version>
      </properties>
    </profile>

    <profile>
      <id>windows-grunt</id>
      <activation>
        <os>
          <family>Windows</family>
        </os>
      </activation>
      <properties>
        <grunt-executable>grunt.cmd</grunt-executable>
        <npm-executable>npm.cmd</npm-executable>
        <phantomjs-executable>${basedir}/node_modules/.bin/phantomjs.cmd</phantomjs-executable>
        <jetty-use-file-lock>false</jetty-use-file-lock>
      </properties>
    </profile>

    <profile>
      <id>apollo</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>

      <dependencies>
        <dependency>
          <groupId>org.apache.activemq</groupId>
          <artifactId>apollo-broker</artifactId>
          <version>${apollo-version}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.apache.activemq</groupId>
          <artifactId>apollo-stomp</artifactId>
          <version>${apollo-version}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.apache.activemq</groupId>
          <artifactId>apollo-openwire</artifactId>
          <version>${apollo-version}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.apache.activemq</groupId>
          <artifactId>apollo-mqtt</artifactId>
          <version>${apollo-version}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.apache.activemq</groupId>
          <artifactId>apollo-amqp</artifactId>
          <version>${apollo-version}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.apache.activemq</groupId>
          <artifactId>apollo-leveldb</artifactId>
          <version>${apollo-version}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.apache.activemq</groupId>
          <artifactId>apollo-jmx</artifactId>
          <version>${apollo-version}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.apache.activemq</groupId>
          <artifactId>apollo-web</artifactId>
          <classifier>classes</classifier>
          <version>${apollo-version}</version>
          <exclusions>
            <exclusion>
              <groupId>org.fusesource.scalate</groupId>
              <artifactId>scalate-core_2.10</artifactId>
            </exclusion>
          </exclusions>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.scala-lang</groupId>
          <artifactId>scala-library</artifactId>
          <scope>test</scope>
          <version>${scala-version}</version>
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>release</id>
      <properties>
        <chrome-version>${project.version}</chrome-version>
        <warSourceDirectory>${basedir}/dist</warSourceDirectory>
        <maven.war.webxml>${basedir}/src/main/webapp/WEB-INF/web.xml</maven.war.webxml>
        <warSourceExcludes>app/app.js.map</warSourceExcludes>
        <gruntArguments>dist</gruntArguments>
      </properties>
    </profile>

    <profile>
      <id>dist</id>
      <properties>
        <chrome-version>${project.version}</chrome-version>
        <warSourceDirectory>${basedir}/dist</warSourceDirectory>
        <maven.war.webxml>${basedir}/src/main/webapp/WEB-INF/web.xml</maven.war.webxml>
        <warSourceExcludes>app/app.js.map</warSourceExcludes>
        <gruntArguments>dist</gruntArguments>
      </properties>
    </profile>

    <profile>
      <id>chrome</id>
      <properties>
        <gruntE2EOptions />
      </properties>
    </profile>

    <profile>
      <id>itests</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.eirslett</groupId>
            <artifactId>frontend-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>grunt e2e</id>
                <goals>
                  <goal>grunt</goal>
                </goals>
                <phase>integration-test</phase>
                <configuration>
                  <arguments>${gruntE2EArguments} ${gruntE2EOptions}</arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>${jetty-plugin-groupId}</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>start-jetty</id>
                <phase>pre-integration-test</phase>
                <goals>
                  <goal>start</goal>
                </goals>
                <configuration>
                  <daemon>true</daemon>
                  <scanIntervalSeconds>0</scanIntervalSeconds>
                </configuration>
              </execution>
              <execution>
                <id>stop-jetty</id>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>stop</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.gmaven</groupId>
            <artifactId>groovy-maven-plugin</artifactId>
            <version>2.0</version>
            <executions>
              <execution>
                <goals>
                  <goal>execute</goal>
                </goals>
                <phase>verify</phase>
                <configuration>
                  <source>
                    def result = new AntBuilder().fileset(dir: "${basedir}/target/failsafe-reports", includes: 'TEST-*.xml') {
                      containsregexp expression: '(failures|errors)="[^0]'
                    }*.file

                    if (result.size &gt; 0) then fail('There were Protractor test failures/errors')
                  </source>
                </configuration>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy-all</artifactId>
                <version>2.3.7</version>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>kube</id>
      <dependencies>
        <dependency>
          <groupId>io.fabric8</groupId>
          <artifactId>kubernetes-api</artifactId>
          <version>2.0-SNAPSHOT</version>
          <scope>test</scope>
          <exclusions>
            <exclusion>
              <groupId>org.apache.karaf.features</groupId>
              <artifactId>org.apache.karaf.features.core</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.osgi</groupId>
              <artifactId>org.osgi.core</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>io.fabric8</groupId>
          <artifactId>kubernetes-template</artifactId>
          <version>2.0-SNAPSHOT</version>
          <scope>test</scope>
          <exclusions>
            <exclusion>
              <groupId>org.apache.karaf.features</groupId>
              <artifactId>org.apache.karaf.features.core</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.osgi</groupId>
              <artifactId>org.osgi.core</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
      </dependencies>

      <properties>
        <hawtio-config-importURLs>mvn:io.fabric8.quickstarts/fabric8-quickstarts-parent/2.0.1/zip/app,mvn:io.fabric8.jube.images.fabric8/apps/2.0.1/zip/app</hawtio-config-importURLs>
        <hawtio-config-cloneOnStartup>false</hawtio-config-cloneOnStartup>

        <!--
        this points to the local build of fabric8 so that you can modify the wiki to add/remove apps
        without messing with the clean curated wiki generated by the fabric8 build ;)
        -->
        <hawtio-config-dir>../../fabric8/wiki/target/hawtioConfig</hawtio-config-dir>
      </properties>

<!--
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-clean-plugin</artifactId>
            <version>2.5</version>
            <configuration>
              <filesets>
                <fileset>
                  <directory>${basedir}/hawtio-config</directory>
                  <followSymlinks>false</followSymlinks>
                </fileset>
              </filesets>
            </configuration>
          </plugin>
        </plugins>
      </build>
-->
    </profile>

  </profiles>

</project>
