<?xml version="1.0" encoding="UTF-8"?>
<!--

     Copyright 2005-2015 Red Hat, Inc.

     Red Hat licenses this file to you under the Apache License, version
     2.0 (the "License"); you may not use this file except in compliance
     with the License.  You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
     implied.  See the License for the specific language governing
     permissions and limitations under the License.

-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>io.fabric8.forge</groupId>
    <artifactId>forge-parent</artifactId>
    <version>2.3.49</version>
  </parent>
  <artifactId>fabric8-forge-web</artifactId>
  <packaging>war</packaging>
  <name>Fabric8 :: Forge :: Web</name>

  <properties>
    <!-- enable to be able to run the sample -->
    <sample>false</sample>

    <addon.repository>${project.build.directory}/addon-repository</addon.repository>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>fabric8-project</artifactId>
        <version>${fabric8.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.jboss.forge</groupId>
        <artifactId>forge-bom</artifactId>
        <version>${jboss.forge.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>io.fabric8.forge</groupId>
      <artifactId>fabric8-forge-core</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.eclipse.jgit</groupId>
      <artifactId>org.eclipse.jgit</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-rs-service-description</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-integration-cdi</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-frontend-jaxrs</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-transports-http</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-management</artifactId>
    </dependency>


    <dependency>
      <groupId>org.jboss.weld.servlet</groupId>
      <artifactId>weld-servlet</artifactId>
    </dependency>

    <!-- forge stuff -->
    <dependency>
      <groupId>org.jboss.forge.addon</groupId>
      <artifactId>ui-api</artifactId>
    </dependency>

    <!-- testing -->
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>false</filtering>
      </testResource>
    </testResources>

    <plugins>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.4</version>
        <configuration>
          <failOnMissingWebXml>false</failOnMissingWebXml>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>sample</id>
      <activation>
        <property>
          <name>sample</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jboss.forge.furnace</groupId>
            <artifactId>furnace-maven-plugin</artifactId>
            <version>${furnace.version}</version>
            <executions>
              <execution>
                <id>deploy-addons</id>
                <phase>test-compile</phase>
                <goals>
                  <goal>addon-install</goal>
                </goals>
                <inherited>false</inherited>
                <configuration>
                  <addonRepository>${addon.repository}</addonRepository>
                  <addonIds>
                    <addonId>io.fabric8.forge:camel,${project.version}</addonId>
                    <addonId>io.fabric8.forge:devops,${project.version}</addonId>
                    <addonId>io.fabric8.forge:funktion,${project.version}</addonId>
                    <addonId>org.jboss.forge.addon:git,${jboss.forge.version}</addonId>
                  </addonIds>
                </configuration>
              </execution>
            </executions>
          </plugin>


          <plugin>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>9.3.10.v20160621</version>
            <configuration>
                <systemProperties>
                  <systemProperty>
                    <name>FORGE_ADDON_DIRECTORY</name>
                    <value>${addon.repository}</value>
                  </systemProperty>
                  <systemProperty>
                    <name>org.eclipse.jetty.annotations.maxWait</name>
                    <value>240</value>
                  </systemProperty>
                </systemProperties>
                <webApp>
                  <contextPath>/</contextPath>
                </webApp>
              </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
