<?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>2.17.2</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <artifactId>hawtio-default</artifactId>
  <packaging>war</packaging>
  <name>${project.artifactId}</name>
  <description>hawtio :: Default Web Application</description>

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

    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-base</artifactId>
      <version>${project.version}</version>
      <!--
        NOTE this WAR dependency type which enables this WAR to
        inherit all the plugins and content from the core hawtio-base WAR
      -->
      <type>war</type>
    </dependency>

    <!-- let's mark dependencies from the WAR as provided to avoid jetty:run adding duplicates -->
    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-core</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j-version}</version>
      <scope>provided</scope>
    </dependency>

    <!-- now let's add some components -->
    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-log</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-ide</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-local-jvm-mbean</artifactId>
      <version>${project.version}</version>
    </dependency>

    <!-- override old version of commons-codec / commons-logging -->
    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <version>${commons-codec-version}</version>
    </dependency>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>${commons-logging-version}</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>${jetty-version}</version>
        <configuration>
          <webAppSourceDirectory>${project.build.directory}/${project.name}</webAppSourceDirectory>
          <scanIntervalSeconds>1</scanIntervalSeconds>
          <webAppConfig>
            <contextPath>${context}</contextPath>
          </webAppConfig>
          <httpConnector>
              <port>${jettyPort}</port>
              <idleTimeout>60000</idleTimeout>
          </httpConnector>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.0</version>
        <configuration>
          <port>9090</port>
          <path>${context}</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>${context}</path>
          <systemProperties>
          </systemProperties>
          <useTestClasspath>false</useTestClasspath>
          <!--
                    <warSourceDirectory>${project.build.directory}/${project.name}-${project.version}</warSourceDirectory>
          -->
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <configuration>
          <filesets>
            <fileset>
              <directory>${basedir}/overlays</directory>
              <includes>
                <include>**/*.*</include>
              </includes>
              <followSymlinks>false</followSymlinks>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
