<!--

     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.fab.tests</groupId>
    <artifactId>tests-project</artifactId>
    <version>1.2.0.Beta2</version>
  </parent>

  <artifactId>fab-sample-camel-velocity-require-bundle</artifactId>
  <packaging>jar</packaging>

  <name>Fabric8 :: FAB (deprecated) :: Tests :: Camel Velocity Require Bundle</name>

  <dependencies>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.core</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-velocity</artifactId>
      <version>${camel-version}</version>
      <scope>provided</scope>
      <!-- exclude this bad osgi bundle which only supports version 0.0.0 it seems -->
      <exclusions>
        <exclusion>
          <groupId>org.apache.velocity</groupId>
          <artifactId>velocity</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- as the code is using camel osgi api -->
<!--
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-blueprint</artifactId>
      <version>${camel-version}</version>
      <scope>provided</scope>
    </dependency>
-->

    <!-- lets add a working velocity bundle  -->
    <dependency>
      <groupId>org.apache.servicemix.bundles</groupId>
      <artifactId>org.apache.servicemix.bundles.velocity</artifactId>
      <version>1.7_3</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.servicemix.bundles</groupId>
      <artifactId>org.apache.servicemix.bundles.oro</artifactId>
      <version>2.0.8_5</version>
      <scope>provided</scope>
    </dependency>

    <!-- add a missing dependency from camel-velocity -->
    <dependency>
      <groupId>org.springframework.osgi</groupId>
      <artifactId>spring-osgi-core</artifactId>
      <version>${spring-osgi-version}</version>
      <scope>provided</scope>
      <exclusions>
        <!-- exclude old spring -->
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-aop</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-beans</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-context</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <repositories>
    <!-- ServiceMix repo -->
    <repository>
        <id>servicemix</id>
        <name>Apache ServiceMix Repository</name>
        <url>http://svn.apache.org/repos/asf/servicemix/m2-repo</url>
        <releases>
            <enabled>true</enabled>
        </releases>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
  </repositories>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <index>true</index>
            <manifestEntries>
              <Bundle-Activator>io.fabric8.fab.sample.camel.Activator</Bundle-Activator>
              <FAB-Dependency-Require-Bundle>org.apache.camel</FAB-Dependency-Require-Bundle>

              <!-- exclude some velocity / spring dependencies -->
              <!-- note we exclude camel-core-xml as its bundled inside camel-spring -->
              <FAB-Exclude-Dependency>javax.el javax.inject com.springsource.slf4j* com.springsource.log4j* com.springsource.edu.emory.mathcs.backport org.apache.camel:camel-core-xml</FAB-Exclude-Dependency>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.fusesource.mvnplugins</groupId>
        <artifactId>maven-fab-plugin</artifactId>
        <version>${maven-fab-plugin-version}</version>
        <configuration>
          <descriptor>
            <Long-Description />
            <!-- <Endorsed-Extensions>
              ${project.groupId}:artifact:${project.version}
            </Endorsed-Extensions>
            <Default-Extensions>name</Default-Extensions> -->
          </descriptor>
        </configuration>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
