<?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.2-M2</version>
  </parent>

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

  <properties>
    <webapp-dir>${project.artifactId}-${project.version}</webapp-dir>
    <webapp-outdir>${basedir}/target/${webapp-dir}</webapp-outdir>
    <grunt-executable>grunt</grunt-executable>
    <npm-executable>npm</npm-executable>
    <phantomjs-executable>${basedir}/node_modules/.bin/phantomjs</phantomjs-executable>
    <schema-outdir>${project.build.directory}/schema/js</schema-outdir>
  </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>

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

    <!-- for proxy support -->
    <dependency>
      <groupId>commons-httpclient</groupId>
      <artifactId>commons-httpclient</artifactId>
      <version>${commons-httpclient-version}</version>
    </dependency>

    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>${commons-io-version}</version>
    </dependency>

    <dependency>
      <groupId>commons-fileupload</groupId>
      <artifactId>commons-fileupload</artifactId>
      <version>${commons-fileupload-version}</version>
    </dependency>

    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <version>${commons-codec-version}</version>
    </dependency>

    <!-- testing -->
    <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-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</groupId>
      <artifactId>hawtio-spring-config</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>


    <!-- Camel module -->
<!--
    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-camel</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>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${guava-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>${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>jetty-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-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-jackson</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>org.fusesource.insight</groupId>
      <artifactId>insight-log4j</artifactId>
      <version>${insight-log4j.version}</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <repositories>
    <repository>
       <id>JBoss.org Public Repository</id>
       <releases>
          <enabled>true</enabled>
       </releases>
       <snapshots>
          <enabled>true</enabled>
       </snapshots>
       <url>http://repository.jboss.org/nexus/content/groups/public/</url>
    </repository>
  </repositories>

  <build>

    <plugins>
      <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>jar</supportedProjectType>
            <supportedProjectType>bundle</supportedProjectType>
            <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</Embed-Dependency>
            <Embed-Transitive>true</Embed-Transitive>

            <!-- fix jgit, and slf4j imports -->
            <Import-Package>
              org.apache.commons.logging;resolution:=optional,
              org.slf4j;resolution:=optional,
              !org.slf4j.impl,
              !org.apache.avalon*,
              !org.apache.log*,

              !com.jcraft.jzlib,
              !com.ibm.uvm.tools*,!com.sun.jdmk.comm*,!javax.jmdns*,!javax.jms*,!javax.portlet*,
              !org.apache.commons.io*,
              *
            </Import-Package>

            <Bundle-ClassPath>.,WEB-INF/classes</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>${webapp-outdir}</warSourceDirectory>
          <packagingExcludes>
            **/classes/OSGI-INF/**,
            **/*.ts,
            */debug/**
          </packagingExcludes>
          <failOnMissingWebXml>false</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>
<!--
          <webResources>
            <resource>
              <filtering>true</filtering>
              <directory>src/main/resources</directory>
              <includes>
                <include>**/*.*</include>
              </includes>
            </resource>
          </webResources>
-->
        </configuration>
      </plugin>

      <plugin>
        <groupId>io.hawt</groupId>
        <artifactId>hawtio-json-schema-generator-plugin</artifactId>
        <version>${project.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>generate-json-schema</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <classes>
            <org.fusesource.fabric.api.CreateChildContainerOptions>
              ${schema-outdir}/createChildContainerOptions.js
            </org.fusesource.fabric.api.CreateChildContainerOptions>
            <org.fusesource.fabric.api.CreateSshContainerOptions>
              ${schema-outdir}/createSshContainerOptions.js
            </org.fusesource.fabric.api.CreateSshContainerOptions>
            <org.fusesource.fabric.api.CreateJCloudsContainerOptions>
              ${schema-outdir}/createJcloudsContainerOptions.js
            </org.fusesource.fabric.api.CreateJCloudsContainerOptions>
            <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>org.fusesource.fabric</groupId>
            <artifactId>fabric-core</artifactId>
            <version>${fabric-version}</version>
          </dependency>
          <dependency>
            <groupId>org.fusesource.fabric</groupId>
            <artifactId>fabric-api</artifactId>
            <version>${fabric-version}</version>
          </dependency>
          <dependency>
            <groupId>io.hawt</groupId>
            <artifactId>hawtio-dozer-schemagen</artifactId>
            <version>${project.version}</version>
          </dependency>
        </dependencies>
      </plugin>

      <!--
      <plugin>
        <groupId>com.ppedregal.typescript</groupId>
        <artifactId>typescript-maven-plugin</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <configuration>
          <useTsc>true</useTsc>
          <sourceDirectory>src/main/webapp/ts</sourceDirectory>
          <targetDirectory>src/main/webapp/js</targetDirectory>
        </configuration>
      </plugin>
      -->
      <!--
            <plugin>
              <artifactId>maven-clean-plugin</artifactId>
              <version>2.5</version>
              <configuration>
                <filesets>
                  <fileset>
                    <directory>src/main/webapp/js</directory>
                    <includes>
                      <include>app.js</include>
                    </includes>
                  </fileset>
                </filesets>
              </configuration>
            </plugin>
      -->

      <plugin>
        <groupId>${jetty-plugin-groupId}</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>${jetty-version}</version>
        <configuration>
          <webAppSourceDirectory>${project.build.directory}/${project.name}-${project.version}</webAppSourceDirectory>
          <scanIntervalSeconds>0</scanIntervalSeconds>
          <useTestScope>true</useTestScope>
          <webAppConfig>
            <contextPath>${context}</contextPath>
          </webAppConfig>
          <connectors>
            <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
              <port>${jettyPort}</port>
              <maxIdleTime>60000</maxIdleTime>
            </connector>
          </connectors>
          <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>karaf.data</key>
              <value>${project.build.directory}/karaf-data</value>
            </systemProperty>
            <systemProperty>
              <key>hawtio.authenticationEnabled</key>
              <value>false</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>${project.build.directory}/${project.name}-${project.version}</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>${project.build.directory}/${project.name}-${project.version}</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>1.1.1</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>
          </systemProperties>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>grunt</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>${exec-maven-plugin-version}</version>
            <executions>
              <execution>
                <id>npm-install</id>
                <phase>compile</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
                <configuration>
                  <executable>${npm-executable}</executable>
                  <arguments>
                    <argument>install</argument>
                  </arguments>
                </configuration>
              </execution>
              <execution>
                <id>typescript-compile</id>
                <phase>compile</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
                <configuration>
                  <executable>${grunt-executable}</executable>
                  <arguments>
                    <argument>--webapp_outdir</argument>
                    <argument>${webapp-outdir}</argument>
                    <argument>--webapp_port</argument>
                    <argument>${jettyPort}</argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>nogrunt</id>
    </profile>

    <profile>
      <id>watch</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>${exec-maven-plugin-version}</version>
            <executions>
              <execution>
                <id>typescript-watch</id>
                <phase>package</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
                <configuration>
                  <executable>${grunt-executable}</executable>
                  <arguments>
                    <argument>watchSrc</argument>
                    <argument>--webapp_outdir</argument>
                    <argument>${webapp-outdir}</argument>
                    <argument>--webapp_port</argument>
                    <argument>${jettyPort}</argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </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>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>fabric</id>

      <!-- when using the exec:java target this will try to auto-connect to a local fuse fabric -->
      <properties>
        <fabricUrl>localhost:2181</fabricUrl>
<!--
        <fabric-version>99-master-SNAPSHOT</fabric-version>
-->
      </properties>
    </profile>

    <profile>
      <id>fabricSnapshot</id>

      <!-- when using the exec:java target this will try to auto-connect to a local fuse fabric -->
      <properties>
        <fabricUrl>localhost:2181</fabricUrl>
      </properties>

      <dependencies>
        <dependency>
          <groupId>io.hawt.example.services</groupId>
          <artifactId>example-fabric</artifactId>
          <version>${project.version}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.fusesource.fabric</groupId>
          <artifactId>tooling-fabric-all</artifactId>
          <version>${fabric-version}</version>
          <exclusions>
            <exclusion>
              <groupId>org.apache.karaf.shell</groupId>
              <artifactId>org.apache.karaf.shell.console</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>org.fusesource.fabric</groupId>
          <artifactId>fabric-zookeeper</artifactId>
          <version>${fabric-version}</version>
        </dependency>
        <dependency>
          <groupId>org.linkedin</groupId>
          <artifactId>org.linkedin.zookeeper-impl</artifactId>
          <version>${linkedin-zookeeper-version}</version>
          <exclusions>
            <exclusion>
              <groupId>com.sun.jdmk</groupId>
              <artifactId>jmxtools</artifactId>
            </exclusion>
            <exclusion>
              <groupId>com.sun.jmx</groupId>
              <artifactId>jmxri</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>camelSnapshot</id>
      <properties>
        <camel-version>2.12-SNAPSHOT</camel-version>
      </properties>
    </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>

    <!--
    this profile is here so we disable the jasmine profile when releasing
    as for some reason it fails when ran inside mvn release:prepare
    -->
    <profile>
      <id>release</id>
    </profile>

    <profile>
      <id>jasmine-test</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>${exec-maven-plugin-version}</version>
            <executions>
              <execution>
                <id>PhantomJS Unit Testing</id>
                <phase>test</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <executable>${phantomjs-executable}</executable>
              <workingDirectory>src/test/specs</workingDirectory>
              <arguments>
                <argument>phantomjs_jasminexml_runner.js</argument>
                <argument>SpecRunner.html</argument>
                <argument>${project.build.directory}/surefire-reports</argument>
              </arguments>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
