<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Hibernate, Relational Persistence for Idiomatic Java
  ~
  ~ License: GNU Lesser General Public License (LGPL), version 2.1 or later.
  ~ See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
  -->
<features>
  <feature name="hibernate-test">

    <!-- JTA -->
    <config name="org.apache.aries.transaction">
      aries.transaction.recoverable = true
      aries.transaction.timeout = 600
      aries.transaction.howl.logFileDir = /tmp/karaf/txlog
      aries.transaction.howl.maxLogFiles = 2
      aries.transaction.howl.maxBlocksPerFile = 512
      aries.transaction.howl.bufferSizeKBytes = 4
    </config>
    <bundle dependency="true" start-level="30">mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1</bundle>
    <bundle start-level="30">mvn:org.apache.aries.transaction/org.apache.aries.transaction.blueprint/1.0.0</bundle>
    <bundle start-level="30">mvn:org.apache.aries.transaction/org.apache.aries.transaction.manager/1.0.1</bundle>

    <!-- JPA -->
    <bundle start-level="30">mvn:org.hibernate.javax.persistence/hibernate-jpa-2.1-api/1.0.0.Final</bundle>
    <!-- No container currently supports JPA 2.1.  Clone and build Aries from the following fork (upgrades to
         JPA 2.1).  Aries should be upgrading as soon as the spec is out.
         https://github.com/brmeyer/aries/tree/jpa21 -->
    <bundle start-level="30">mvn:org.apache.aries/org.apache.aries.util/1.1.1-SNAPSHOT</bundle>
    <bundle start-level="30">mvn:org.apache.aries.jpa/org.apache.aries.jpa.api/1.0.1-SNAPSHOT</bundle>
    <bundle start-level="30">mvn:org.apache.aries.jpa/org.apache.aries.jpa.blueprint.aries/1.0.2-SNAPSHOT</bundle>
    <bundle start-level="30">mvn:org.apache.aries.jpa/org.apache.aries.jpa.container/1.0.1-SNAPSHOT</bundle>
    <bundle start-level="30">mvn:org.apache.aries.jpa/org.apache.aries.jpa.container.context/1.0.2-SNAPSHOT</bundle>

    <!-- JNDI -->
    <bundle start-level="30">mvn:org.apache.aries/org.apache.aries.util/1.0.0</bundle>
    <bundle start-level="30">mvn:org.apache.aries.jndi/org.apache.aries.jndi.api/1.0.0</bundle>
    <bundle start-level="30">mvn:org.apache.aries.jndi/org.apache.aries.jndi.core/1.0.0</bundle>
    <bundle start-level="30">mvn:org.apache.aries.jndi/org.apache.aries.jndi.rmi/1.0.0</bundle>
    <bundle start-level="30">mvn:org.apache.aries.jndi/org.apache.aries.jndi.url/1.0.0</bundle>
    <bundle start-level="30">mvn:org.apache.aries.jndi/org.apache.aries.jndi.legacy.support/1.0.0</bundle>

    <!-- Taken from Karaf-Tutorial -->
    <bundle>mvn:commons-collections/commons-collections/3.2.1</bundle>
    <bundle>mvn:commons-pool/commons-pool/1.5.4</bundle>
    <bundle>mvn:commons-dbcp/commons-dbcp/1.4</bundle>
    <bundle>mvn:commons-lang/commons-lang/2.6</bundle>
    <bundle>wrap:mvn:net.sourceforge.serp/serp/1.13.1</bundle>

    <bundle>mvn:com.h2database/h2/1.3.170</bundle>
    <bundle>blueprint:file:/[PATH]/datasource-h2.xml</bundle>

    <!-- These do not natively support OSGi, so using 3rd party bundles. -->
    <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr/2.7.7_5</bundle>
    <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/1.6.1_5</bundle>

    <!-- These do not natively support OSGi, so wrap with BND. -->
    <bundle>wrap:mvn:org.jboss/jandex/1.1.0.Final</bundle>

    <bundle>mvn:com.fasterxml/classmate/0.8.0</bundle>
    <bundle>mvn:org.apache.logging.log4j/log4j-api/2.0</bundle>
    <bundle>mvn:log4j/log4j/1.2.17</bundle>
    <bundle>mvn:org.jboss.logging/jboss-logging/3.2.1.Final</bundle>
    <bundle>mvn:org.javassist/javassist/3.18.1-GA</bundle>

    <bundle>mvn:org.hibernate.common/hibernate-commons-annotations/4.0.5.Final</bundle>

    <bundle>mvn:org.hibernate/hibernate-core/$version</bundle>
    <bundle>mvn:org.hibernate/hibernate-entitymanager/$version</bundle>

    <!-- TODO: It seems that the persistence unit bundle needs to be started
    before hibernate-osgi.  When the BundleActivator is started,
    the persistence unit is provided even though managed-jpa
    hasn't completely started yet.  If that happens, you'll get an "illegal
    bundle state" exception.  Is there a way for the activator to
    watch for bundles with PUs before registering the persistence provider? -->
    <bundle>mvn:org.hibernate.osgi/managed-jpa/1.0.0</bundle>

    <bundle>mvn:org.hibernate/hibernate-osgi/$version</bundle>
  </feature>
</features>
