<?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.1</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>${webapp-outdir}/lib</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-junit</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-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-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>


    <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-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-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>org.fusesource.insight</groupId>
      <artifactId>insight-log4j</artifactId>
      <version>${insight-log4j.version}</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>

    <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>
        <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>1.6</version>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <configuration>
              <target>
                
                <!-- copy the markdown docs into the site plugin  -->
                <echo>Hello</echo>
                <copy tofile="${webapp-outdir}/index.html" file="${basedir}/src/main/webapp/index.html" overwrite="true">
                  <filterchain>
                    <filterreader classname="org.apache.tools.ant.filters.ReplaceTokens">
                      <param type="token" name="VERSION" value="${project.version}" />
                    </filterreader>
                  </filterchain>
                </copy>
                
                <copy todir="${webapp-outdir}/app/site" overwrite="true">
                  <fileset dir="${basedir}/..">
                    <include name="*.md" />
                  </fileset>
                </copy>
                <copy todir="${webapp-outdir}/app/site/doc" overwrite="true">
                  <fileset dir="${basedir}/../docs">
                    <include name="**/*.md" />
                    <include name="**/*.html" />
                    <include name="images/*.*" />
                  </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>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.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.slf4j.impl,
              !org.apache.avalon*,
              !org.apache.log*,

              !com.jcraft.jzlib,
              !keypairgen,
              !signature,
              !userauth,
              !com.ibm.uvm.tools*,!com.sun.jdmk.comm*,!javax.jmdns*,!javax.jms*,!javax.portlet*,
              !org.apache.commons.io*,
              *
            </Import-Package>
            <Private-Package>
              javaewah
            </Private-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>
            <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>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>

      <plugin>
        <groupId>${jetty-plugin-groupId}</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>${jetty-version}</version>
        <configuration>
          <webAppConfig>
            <contextPath>${context}</contextPath>
            <baseResource implementation="org.eclipse.jetty.util.resource.ResourceCollection">
              <resourcesAsCSV>src/main/webapp,${webapp-outdir}</resourcesAsCSV>
            </baseResource>
          </webAppConfig>
          <scanIntervalSeconds>0</scanIntervalSeconds>
          <useTestScope>true</useTestScope>
          <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>
            <systemProperty>
              <key>hawtio.forceBranding</key>
              <value>true</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>
            <systemProperty>
              <key>hawtio.authenticationEnabled</key>
              <value>false</value>
            </systemProperty>
            <systemProperty>
              <key>hawtio.forceBranding</key>
              <value>false</value>
            </systemProperty>
          </systemProperties>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>

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