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

    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="enterprise-legacy-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.3.0 http://karaf.apache.org/xmlns/features/v1.3.0">

    <!-- NB: this file is not the one really used. This file is used by the karaf-maven-plugin to define the start-level of bundles in the generated feature.xml -->

    <repository>mvn:org.apache.karaf.features/standard/${project.version}/xml/features</repository>
    <repository>mvn:org.apache.karaf.features/enterprise/${project.version}/xml/features</repository>
    <repository>mvn:org.hibernate/hibernate-osgi/${hibernate52.version}/xml/karaf</repository>

    <feature name="transaction-api" version="1.1.0">
        <bundle>mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/${geronimo.jta-spec.version}</bundle>
    </feature>

    <feature name="transaction" description="OSGi Transaction Manager" version="${aries.transaction.manager.version}">
        <details>JTA implementation provided by Apache Aries Transaction</details>
        <feature version="${geronimo.transaction.manager.version}">transaction-manager-geronimo</feature>
    </feature>

    <feature name="jpa" description="OSGi Persistence Container" version="${aries.jpa.container.context.version}">
        <details>JPA implementation provided by Apache Aries JPA 1.x. NB: this feature doesn"t provide the JPA engine, you have to install one by yourself (OpenJPA for instance)</details>
        <feature version="[1.1,2)">transaction-api</feature>
	    <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/${geronimo.jpa-spec.version}</bundle>
        <bundle dependency="true" start-level="30">mvn:org.apache.aries/org.apache.aries.util/${aries.util.version}</bundle>
        <bundle start-level="30">mvn:org.apache.aries.jpa/org.apache.aries.jpa.api/${aries.jpa.version}</bundle>
        <bundle start-level="30">mvn:org.apache.aries.jpa/org.apache.aries.jpa.container/${aries.jpa.version}</bundle>
        <bundle start-level="30">mvn:org.apache.aries.jpa/org.apache.aries.jpa.container.context/${aries.jpa.container.context.version}</bundle>
        <conditional>
            <condition>aries-blueprint</condition>
            <bundle start-level="30">mvn:org.apache.aries.jpa/org.apache.aries.jpa.blueprint.aries/${aries.jpa.blueprint.aries.version}</bundle>
        </conditional>
    </feature>

    <feature name="openjpa" description="Apache OpenJPA 2.2.x persistence engine support" version="2.2.2">
        <details>Enable Apache OpenJPA as persistence engine.</details>
        <feature>jndi</feature>
        <feature version="[1.1,1.2)">transaction-api</feature>
	    <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/${geronimo.jpa-spec.version}</bundle>
        <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-annotation_1.0_spec/1.1.1</bundle>
        <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-servlet_2.5_spec/1.2</bundle>
        <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-el_1.0_spec/1.0.1</bundle>
        <bundle dependency="true">mvn:commons-lang/commons-lang/${commons-lang.version}</bundle>
        <bundle dependency="true">mvn:commons-collections/commons-collections/${commons-collections.version}</bundle>
        <bundle dependency="true">mvn:commons-pool/commons-pool/${commons-pool.version}</bundle>
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-dbcp/${commons-dbcp.version}</bundle>
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ant/1.7.0_6</bundle>
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/${serp.bundle.version}</bundle>
        <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/${geronimo.jms-spec.version}</bundle>
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.asm/3.3_2</bundle>
        <bundle>mvn:org.apache.openjpa/openjpa/2.2.2</bundle>
        <capability>
            osgi.service;effective:=active;objectClass=javax.persistence.spi.PersistenceProvider
        </capability>
    </feature>

    <feature name="openjpa" description="Apache OpenJPA 2.3.x persistence engine support" version="2.3.0">
        <details>Enable Apache OpenJPA as persistence engine.</details>
        <feature version="[1.1,1.2)">transaction-api</feature>
	    <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/${geronimo.jpa-spec.version}</bundle>
        <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-annotation_1.0_spec/1.1.1</bundle>
        <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-servlet_2.5_spec/1.2</bundle>
        <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-el_1.0_spec/1.0.1</bundle>
        <bundle dependency="true">mvn:commons-lang/commons-lang/${commons-lang.version}</bundle>
        <bundle dependency="true">mvn:commons-collections/commons-collections/${commons-collections.version}</bundle>
        <bundle dependency="true">mvn:commons-pool/commons-pool/${commons-pool.version}</bundle>
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-dbcp/${commons-dbcp.version}</bundle>
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ant/1.7.0_6</bundle>
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/${serp.bundle.version}</bundle>
        <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/${geronimo.jms-spec.version}</bundle>
        <bundle dependency="true">mvn:org.apache.xbean/xbean-asm4-shaded/3.16</bundle>
        <bundle>mvn:org.apache.openjpa/openjpa/2.3.0</bundle>
        <requirement>osgi.ee;filter:="(&amp;(osgi.ee=JavaSE)(!(version>=1.9)))"</requirement>
        <capability>
            osgi.service;effective:=active;objectClass=javax.persistence.spi.PersistenceProvider
        </capability>
    </feature>

    <feature name="openjpa" description="Apache OpenJPA 2.4.x persistence engine support" version="2.4.2">
        <details>Enable Apache OpenJPA as persistence engine.</details>
        <feature>jndi</feature>
        <feature version="[1.2,1.3)">transaction-api</feature>
        <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/${geronimo.jpa-spec.version}</bundle>
        <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-annotation_1.0_spec/1.1.1</bundle>
        <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-servlet_2.5_spec/1.2</bundle>
        <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-el_1.0_spec/1.0.1</bundle>
        <bundle dependency="true">mvn:commons-lang/commons-lang/${commons-lang.version}</bundle>
        <bundle dependency="true">mvn:commons-collections/commons-collections/${commons-collections.version}</bundle>
        <bundle dependency="true">mvn:commons-pool/commons-pool/${commons-pool.version}</bundle>
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-dbcp/${commons-dbcp.version}</bundle>
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ant/1.7.0_6</bundle>
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/${serp.bundle.version}</bundle>
        <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/${geronimo.jms-spec.version}</bundle>
        <bundle dependency="true">mvn:org.apache.xbean/xbean-asm5-shaded/4.3</bundle>
        <bundle>mvn:org.apache.openjpa/openjpa/2.4.2</bundle>
        <capability>
            osgi.service;objectClass=javax.persistence.spi.PersistenceProvider;effective:=active;javax.persistence.provider=org.apache.openjpa.persistence.PersistenceProviderImpl
        </capability>
    </feature>

    <feature name="hibernate" description="Hibernate 4.2.x JPA persistence engine support" version="${hibernate42.version}">
        <details>Enable Hibernate 4.2.x as persistence engine.</details>
	    <bundle dependency="true">mvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/${geronimo.jpa-spec.version}</bundle>
        <feature>http</feature>
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr/${antlr.bundle.version}</bundle>
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ant/1.10.9_1</bundle>
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/${dom4j.bundle.version}</bundle>
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/${serp.bundle.version}</bundle>
        <bundle dependency="true">mvn:com.fasterxml/classmate/1.1.0</bundle>
        <bundle dependency="true">mvn:org.javassist/javassist/3.18.1-GA</bundle>
        <bundle dependency="true">mvn:org.jboss.spec.javax.security.jacc/jboss-jacc-api_1.4_spec/1.0.2.Final</bundle>
        <bundle dependency="true">mvn:org.jboss/jandex/1.2.2.Final</bundle>
        <bundle dependency="true">mvn:org.jboss.logging/jboss-logging/3.1.4.GA</bundle>
        <bundle dependency="true">mvn:org.hibernate.common/hibernate-commons-annotations/4.0.4.Final</bundle>
        <bundle>mvn:org.hibernate/hibernate-core/${hibernate42.version}</bundle>
        <bundle>mvn:org.hibernate/hibernate-entitymanager/${hibernate42.version}</bundle>
        <bundle>mvn:org.hibernate/hibernate-osgi/${hibernate42.version}</bundle>
        <capability>
            osgi.service;effective:=active;objectClass=javax.persistence.spi.PersistenceProvider
        </capability>
    </feature>

    <feature name="hibernate-envers" description="Hibernate Envers 4.2.x" version="${hibernate42.version}">
        <details>Enable Hibernate Envers 4.2.x</details>
        <feature version="[4.2,4.3)">hibernate</feature>
        <bundle>mvn:org.hibernate/hibernate-envers/${hibernate42.version}</bundle>
    </feature>

    <feature name="hibernate" description="Hibernate 4.3.x JPA persistence engine support" version="${hibernate43.version}">
        <details>Enable Hibernate 4.3.x as persistence engine.</details>
        <feature>http</feature>
        <bundle dependency="true">mvn:org.eclipse.persistence/javax.persistence/2.1.0</bundle>
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr/${antlr.bundle.version}</bundle>
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ant/1.10.9_1</bundle>
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/${dom4j.bundle.version}</bundle>
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/${serp.bundle.version}</bundle>
        <bundle dependency="true">mvn:com.fasterxml/classmate/1.1.0</bundle>
        <bundle dependency="true">mvn:org.javassist/javassist/3.18.1-GA</bundle>
        <bundle dependency="true">mvn:org.jboss.spec.javax.security.jacc/jboss-jacc-api_1.4_spec/1.0.2.Final</bundle>
        <bundle dependency="true">mvn:org.jboss/jandex/1.2.2.Final</bundle>
        <bundle dependency="true">mvn:org.jboss.logging/jboss-logging/3.1.4.GA</bundle>
        <bundle dependency="true">mvn:org.hibernate.common/hibernate-commons-annotations/4.0.4.Final</bundle>
        <bundle>mvn:org.hibernate/hibernate-core/${hibernate43.version}</bundle>
        <bundle>mvn:org.hibernate/hibernate-entitymanager/${hibernate43.version}</bundle>
        <bundle>mvn:org.hibernate/hibernate-osgi/${hibernate43.version}</bundle>
        <capability>
            osgi.service;effective:=active;objectClass=javax.persistence.spi.PersistenceProvider
        </capability>
    </feature>

    <feature name="hibernate-envers" description="Hibernate Envers 4.3.x" version="${hibernate43.version}">
        <details>Enable Hibernate Envers 4.3.x</details>
        <feature version="[4.3,4.4)">hibernate</feature>
        <bundle>mvn:org.hibernate/hibernate-envers/${hibernate43.version}</bundle>
    </feature>

    <feature name="hibernate" description="Hibernate JPA engine support" version="${hibernate52.version}">
        <feature prerequisite="true">wrap</feature>
        <feature version="${hibernate52.version}">hibernate-orm</feature>
        <bundle dependency="true">mvn:net.bytebuddy/byte-buddy/1.6.6</bundle>
        <capability>
            osgi.service;objectClass=javax.persistence.spi.PersistenceProvider;effective:=active;javax.persistence.provider=org.hibernate.jpa.HibernatePersistenceProvider
        </capability>
    </feature>

</features>
