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

     Copyright 2005-2014 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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>io.fabric8.quickstarts</groupId>
    <artifactId>fabric8-quickstarts-java-parent</artifactId>
    <version>1.2.0.Beta3</version>
  </parent>

  <groupId>io.fabric8.quickstarts</groupId>
  <artifactId>java-camel-cdi</artifactId>
  <version>1.2.0.Beta3</version>
  <packaging>jar</packaging>

  <name>Fabric8 :: Quickstarts :: Java :: Camel with CDI Java Container</name>
  <description>Shows how to use Camel and CDI and Java Container</description>

  <properties>
    <!-- Explicitly declaring the source encoding eliminates the following
               message: -->
    <!-- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered
        resources, i.e. build is platform dependent! -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <version.compiler.plugin>2.3.1</version.compiler.plugin>
    <version.maven-bundle-plugin>2.3.7</version.maven-bundle-plugin>

    <!-- maven-compiler-plugin -->
    <maven.compiler.target>1.7</maven.compiler.target>
    <maven.compiler.source>1.7</maven.compiler.source>

    <!-- the version of the BOM, defining all the dependency versions -->
    <fabric8.bom.version>1.2.0.Beta3</fabric8.bom.version>
    <fabric.version>1.2.0.Beta3</fabric.version>

    <!-- fabric8 deploy profile configuration -->
    <fabric8.profile>quickstarts-java-camel.cdi</fabric8.profile>
  </properties>


  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <distribution>repo</distribution>
      <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
    </license>
  </licenses>

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

  <dependencies>

    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-cdi</artifactId>
    </dependency>

    <!-- we make use of the javax.ejb.Startup API while running the example -->
    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-ejb_3.1_spec</artifactId>
      <version>${geronimo-ejb-3-1-spec-version}</version>
      <scope>provided</scope>
    </dependency>

    <!-- lets use weld for CDI -->
    <!--
    TODO when this issue is fixed: https://github.com/fabric8io/fabric8/issues/1235

    we could move this transitive dependency tree into the containers-weld profile
    so we keep our project independent of the CDI implementation?
    -->
    <dependency>
      <groupId>org.jboss.weld.se</groupId>
      <artifactId>weld-se</artifactId>
      <version>${weld2-version}</version>
    </dependency>


    <!-- logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
    </dependency>

    <!-- for testing -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.arquillian.junit</groupId>
      <artifactId>arquillian-junit-container</artifactId>
      <version>${arquillian-junit-container-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.shrinkwrap.resolver</groupId>
      <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
      <version>2.0.0-alpha-4</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <id>fusesource.m2</id>
      <name>FuseSource Community Release Repository</name>
      <url>https://repo.fusesource.com/nexus/content/groups/public</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>never</updatePolicy>
      </releases>
    </repository>
    <repository>
      <id>fusesource.ea</id>
      <name>FuseSource Community Early Access Release Repository</name>
      <url>https://repo.fusesource.com/nexus/content/groups/ea</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>never</updatePolicy>
      </releases>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>fusesource.m2</id>
      <name>FuseSource Community Release Repository</name>
      <url>https://repo.fusesource.com/nexus/content/groups/public</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>never</updatePolicy>
      </releases>
    </pluginRepository>
    <pluginRepository>
      <id>fusesource.ea</id>
      <name>FuseSource Community Early Access Release Repository</name>
      <url>https://repo.fusesource.com/nexus/content/groups/ea</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>never</updatePolicy>
      </releases>
    </pluginRepository>
  </pluginRepositories>

  <build>
    <finalName>${project.artifactId}</finalName>
    <plugins>
      <!-- Compiler plugin enforces Java 1.7 compatibility and activates annotation processors -->
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${version.compiler.plugin}</version>
        <configuration>
          <source>${maven.compiler.source}</source>
          <target>${maven.compiler.target}</target>
        </configuration>
      </plugin>

      <plugin>
          <!--
            this plugin will use the fabric.* properties to configure its behaviour
            see the Properties section here: http://fabric8.io/gitbook/mavenPlugin.html
          -->
          <groupId>io.fabric8</groupId>
          <artifactId>fabric8-maven-plugin</artifactId>
          <version>${fabric.version}</version>
      </plugin>

      <!-- allows the routes to be run via 'mvn camel:run' -->
      <plugin>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-maven-plugin</artifactId>
        <version>${camel-version}</version>
        <configuration>
          <useCDI>true</useCDI>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
