<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF 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>org.apache.camel</groupId>
    <artifactId>components</artifactId>
    <version>2.19.0</version>
  </parent>

  <artifactId>camel-spring-dm</artifactId>
  <name>Camel :: Spring DM (deprecated)</name>
  <description>Camel SpringDM (OSGi) XML DSL</description>
  <packaging>jar</packaging>

  <properties>
    <!-- use by camel-catalog -->
    <firstVersion>2.18.0</firstVersion>
    <label>osgi,spring</label>
    <title>Spring DM</title>

    <!-- spring-dm only supports spring 3.x so we need to import that range -->
    <camel.osgi.import>
      !org.apache.camel.spring.*,
      !org.apache.camel.component,
      !org.apache.camel.component.event,
      !org.apache.camel.language.spel,
      !org.apache.camel.core.osgi*,
      !org.apache.camel.core.xml*,
      !org.apache.camel.osgi.*,
      !org.springframework.boot.*,
      org.apache.camel.*;${camel.osgi.import.strict.version},
      org.springframework.osgi.*;version="[1.2,2)",
      org.springframework*;version="${spring-dm-version-range}",
      org.osgi.service.event;resolution:=optional,
      ${camel.osgi.import.defaults},
      *
    </camel.osgi.import>
    <camel.osgi.export>
      org.apache.camel.spring.*;${camel.osgi.version},
      org.apache.camel.util.spring.*;${camel.osgi.version},
      org.apache.camel.component.event;${camel.osgi.split.pkg};${camel.osgi.version},
      org.apache.camel.language.spel;${camel.osgi.split.pkg};${camel.osgi.version}
    </camel.osgi.export>
    <camel.osgi.activator>
      org.apache.camel.osgi.Activator
    </camel.osgi.activator>
    <!-- do not skip any tests by default -->
    <platform.skip.tests />
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-spring</artifactId>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.apache.camel</groupId>
      <artifactId>camel-core-osgi</artifactId>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.core</artifactId>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.compendium</artifactId>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.springframework.osgi</groupId>
      <artifactId>spring-osgi-core</artifactId>
      <optional>true</optional>
      <exclusions>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>org.springframework.aop</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>org.springframework.beans</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>org.springframework.context</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>org.springframework.core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>target/schema</directory>
        <includes>
          <include>**/*</include>
        </includes>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
        <includes>
          <include>**/*</include>
        </includes>
        <filtering>true</filtering>
      </resource>
    </resources>

    <plugins>

      <!-- Inline the contents of camel-spring, camel-core-osgi, and camel-core-xml into this bundle. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.10</version>
        <executions>
          <execution>
            <id>unpack</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.apache.camel</groupId>
                  <artifactId>camel-spring</artifactId>
                  <version>${project.version}</version>
                  <includes>org/apache/camel/**</includes>
                  <outputDirectory>${project.build.directory}/classes</outputDirectory>
                </artifactItem>
                <!-- include the embedded spring schemas descriptor -->
                <artifactItem>
                  <groupId>org.apache.camel</groupId>
                  <artifactId>camel-spring</artifactId>
                  <version>${project.version}</version>
                  <includes>META-INF/spring.schemas</includes>
                  <outputDirectory>${project.build.directory}/classes</outputDirectory>
                </artifactItem>
                <artifactItem>
                  <groupId>org.apache.camel</groupId>
                  <artifactId>camel-core-osgi</artifactId>
                  <version>${project.version}</version>
                  <includes>org/apache/camel/**</includes>
                  <outputDirectory>${project.build.directory}/classes</outputDirectory>
                </artifactItem>
                <artifactItem>
                  <groupId>org.apache.camel</groupId>
                  <artifactId>camel-core-xml</artifactId>
                  <version>${project.version}</version>
                  <includes>org/apache/camel/**</includes>
                  <outputDirectory>${project.build.directory}/classes</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Push the execution order of the maven-bundle-plugin further to the end. That's why we add it here again. -->
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>prepare-package</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>

  </build>


</project>
