<?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.

-->

<features name="activemq-core-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">

    <!-- Bundles needed if only client will be deployed in the container -->
    <feature name="activemq-client" description="ActiveMQ client libraries" version="${project.version}">
        <feature version="[5,6)">spring</feature>
        <feature>aries-blueprint</feature>
        <feature>activemq-combined-jms-spec</feature>
        <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-annotation_1.3_spec/1.0</bundle>
        <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1</bundle>
        <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-j2ee-management_1.1_spec/1.0.1</bundle>
        <bundle dependency="true">mvn:org.jvnet.jaxb2_commons/jaxb2-basics-runtime/${jaxb-basics-version}</bundle>
        <bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-runtime/${jaxb-bundle-version}</bundle>
        <bundle>mvn:org.apache.commons/commons-pool2/${commons-pool2-version}</bundle>
        <!-- uber osgi bundle means client is not that lean, todo: introduce client osgi bundle -->
        <bundle>mvn:org.apache.activemq/activemq-osgi/${project.version}</bundle>
    </feature>
    
    <feature name="activemq-cf" description="ActiveMQ ConnectionFactory from config" version="${project.version}">
        <feature>activemq-client</feature>
        <feature>scr</feature>
        <bundle>mvn:org.apache.activemq/activemq-cf/${project.version}</bundle>
    </feature>

    <!-- All bundles needed by the broker -->
    <feature name="activemq" description="ActiveMQ broker libraries" version="${project.version}">
      <feature>connector</feature>
      <feature>http</feature>
      <feature version="${project.version}">activemq-client</feature>
      <bundle dependency="true">mvn:commons-io/commons-io/${commons-io-version}</bundle>
      <bundle dependency="true">mvn:commons-collections/commons-collections/${commons-collections-version}</bundle>
      <bundle dependency="true">mvn:org.apache.commons/commons-lang3/${commons-lang-version}</bundle>
      <bundle dependency="true">mvn:commons-codec/commons-codec/1.15</bundle>
      <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.velocity/1.7_6</bundle>
      <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jasypt/1.9.2_1</bundle>
      <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jasypt-spring31/1.9.2_1</bundle>
      <bundle dependency="true">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.stax-api-1.0/${servicemix.specs.version}</bundle>
      <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xpp3/${xpp3-bundle-version}</bundle>
      <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream/${xstream-bundle-version}</bundle>
      <bundle dependency="true">mvn:org.apache.aries/org.apache.aries.util/${aries-version}</bundle>
      <bundle dependency="true">mvn:org.apache.activemq/activeio-core/${activeio-version}</bundle>
      <bundle dependency="true">mvn:org.codehaus.jettison/jettison/${jettison-version}</bundle>
      <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-core/${jackson-version}</bundle>
      <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-databind/${jackson-version}</bundle>
      <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-annotations/${jackson-version}</bundle>
    </feature>

    <!-- JMS1.1 and JMS2.0 support via the same Geronimo JMS 2 bundle  -->
    <!-- Ideal since all JMS code shares the same class definitions    -->
    <!-- Fortunately, JMS2.0 is fully backward compatible with JMS 1.1 -->
    <feature name="activemq-combined-jms-spec">
        <feature prerequisite="true">wrap</feature>
        <bundle dependency="true">wrap:mvn:org.apache.geronimo.specs/geronimo-jms_2.0_spec/1.0-alpha-2$overwrite=merge&amp;Export-Package=javax.jms;version=1.1,javax.jms;version=2.0</bundle>
    </feature>
</features>
