<?xml version="1.0" encoding="UTF-8"?>
<features name="karaf-features-droolsjbpm-${project.version}"
          xmlns="http://karaf.apache.org/xmlns/features/v1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.0.0 http://karaf.apache.org/xmlns/features/v1.0.0">

  <repository>mvn:org.kie/kie-karaf-features/${project.version}/xml/features-core</repository>
  <repository>mvn:org.apache.camel.karaf/apache-camel/${karaf.version.org.apache.camel}/xml/features</repository>

  <feature name="drools-common" version="${project.version}" description="Drools Commons">
    <bundle>mvn:com.google.protobuf/protobuf-java/${karaf.version.com.google.protobuf}</bundle>
    <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr/${karaf.servicemix.version.org.antlr}</bundle>
    <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream-java8/${karaf.servicemix.version.com.thoughtworks.xstream}</bundle>
    <bundle start-level='10'>mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxb-api-2.2/${karaf.servicemix.version.javax.xml.bind.jaxb}</bundle>
    <bundle start-level='10'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-xjc/${karaf.servicemix.version.com.sun.xml.bind.jaxb}</bundle>
    <bundle start-level='10'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl/${karaf.servicemix.version.com.sun.xml.bind.jaxb}</bundle>
    <bundle>mvn:org.mvel/mvel2/${version.org.mvel}</bundle>
    <bundle>wrap:mvn:org.eclipse.jdt.core.compiler/ecj/${karaf.version.org.eclipse.jdt.core.compiler}$Bundle-SymbolicName=Eclipse-JDT-Compiler&amp;Bundle-Version=${karaf.version.org.eclipse.jdt.core.compiler}</bundle>
    <bundle>wrap:mvn:org.codehaus.janino/janino/${karaf.version.org.codehaus.janino}$Bundle-SymbolicName=Codehaus-Janino&amp;Bundle-Version=${karaf.version.org.codehaus.janino}</bundle>
    <bundle>mvn:org.apache.geronimo.specs/geronimo-atinject_1.0_spec/${karaf.version.javax.inject}</bundle>
    <bundle>wrap:mvn:javax.enterprise/cdi-api/${karaf.version.javax.enterprise.cdi}</bundle>
    <bundle>mvn:org.jboss.spec.javax.el/jboss-el-api_3.0_spec/${karaf.version.org.jboss.spec.javax.el.jboss-el-api_3.0_spec}</bundle>
    <bundle>mvn:org.jboss.spec.javax.interceptor/jboss-interceptors-api_1.2_spec/${karaf.version.org.jboss.spec.javax.interceptor}</bundle>
    <bundle>mvn:commons-codec/commons-codec/${karaf.version.commons-codec}</bundle>
    <bundle>mvn:org.apache.commons/commons-lang3/${version.org.apache.commons.lang3}</bundle>
  </feature>

  <feature name="drools-decisiontable" description="Drools Decision Tables" version="${project.version}">
    <feature version="${project.version}">drools-module</feature>
    <feature version="${project.version}">drools-templates</feature>
    <bundle>mvn:commons-codec/commons-codec/${karaf.version.commons-codec}</bundle>
    <bundle>mvn:org.drools/drools-decisiontables/${version.org.drools}</bundle>
    <bundle>mvn:org.apache.commons/commons-collections4/${karaf.version.org.apache.commons-collections4}</bundle>
    <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi/${karaf.servicemix.version.org.apache.poi}</bundle>
    <bundle>mvn:org.apache.santuario/xmlsec/${karaf.version.org.apache.santurio}</bundle>
    <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver/${karaf.servicemix.version.xmlresolver}</bundle>
  </feature>

  <feature name="drools-wb-guided-decisiontables" description="Drools Workbench Guided Decision Tables" version="${project.version}">
     <feature version="${project.version}">drools-module</feature>
     <bundle>mvn:org.kie.soup/kie-soup-commons/${version.org.kie}</bundle>
     <bundle>mvn:org.kie.soup/kie-soup-project-datamodel-api/${version.org.kie}</bundle>
     <bundle>mvn:org.kie.soup/kie-soup-project-datamodel-commons/${version.org.kie}</bundle>
     <bundle>mvn:org.drools/drools-workbench-models-datamodel-api/${version.org.kie}</bundle>
     <bundle>mvn:org.drools/drools-workbench-models-commons/${version.org.kie}</bundle>
     <bundle>mvn:org.apache.commons/commons-lang3/${version.org.apache.commons.lang3}</bundle>
     <bundle>mvn:org.drools/drools-workbench-models-guided-dtable/${version.org.kie}</bundle>
   </feature>
   
   <feature name="kie-dmn" description="Kie DMN" version="${project.version}">
     <feature version="${project.version}">drools-module</feature>
     <bundle>mvn:org.antlr/antlr4-runtime/${version.org.antlr4}</bundle>
     <bundle>mvn:ch.obermuhlner/big-math/${version.ch.obermuhlner}</bundle>
     <bundle>mvn:org.drools/drlx-parser/${version.org.kie}</bundle>
     <bundle>mvn:org.kie/kie-dmn-model/${version.org.kie}</bundle>
     <bundle>mvn:org.kie/kie-dmn-api/${version.org.kie}</bundle>
     <bundle>mvn:org.kie/kie-dmn-backend/${version.org.kie}</bundle>
     <bundle>mvn:org.kie/kie-dmn-feel/${version.org.kie}</bundle>
     <bundle>mvn:org.kie/kie-dmn-core/${version.org.kie}</bundle>
   </feature>

  <feature name="jbpm-commons" version="${project.version}" description="jBPM Commons">
    <!-- This feature is Fuse version specific, so it is defined differently in the features.xml and features-fuse-6_3.xml files -->
    <feature version="${project.version}">servlet-api-kie</feature>
    <bundle>mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.scripting-api-1.0/${karaf.servicemix.version.scripting-api}</bundle>
    <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.quartz/${karaf.servicemix.version.org.quartz-scheduler}</bundle>
    <bundle>mvn:org.jboss.spec.javax.security.jacc/jboss-jacc-api_1.5_spec/${karaf.version.org.jboss.spec.javax.security.jacc}</bundle>
    <bundle>mvn:joda-time/joda-time/${karaf.version.joda-time}</bundle>
    <bundle>mvn:org.jboss.spec.javax.interceptor/jboss-interceptors-api_1.2_spec/${karaf.version.org.jboss.spec.javax.interceptor}</bundle>
    <bundle>mvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/${karaf.version.org.apache.geronimo.specs.jms}</bundle>
    <bundle>mvn:org.apache.geronimo.specs/geronimo-jpa_2.1_spec/${karaf.version.org.apache.geronimo.specs.jpa}</bundle>
    <bundle>mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/${karaf.version.org.apache.geronimo.specs.jta}</bundle>
  </feature>

  <feature name="jbpm-human-task" version="${project.version}" description="jBPM Human Task">
    <feature version="${project.version}">drools-module</feature>
    <feature version="${project.version}">drools-jpa</feature>
    <feature version="${project.version}">jbpm-commons</feature>
    <bundle>mvn:com.google.guava/guava/${version.com.google.guava}</bundle>
    <bundle>mvn:com.fasterxml.jackson.core/jackson-annotations/${version.com.fasterxml.jackson}</bundle>
    <bundle>mvn:javax.mail/mail/${version.javax.mail}</bundle>
    <bundle>mvn:org.jbpm/jbpm-flow/${version.org.jbpm}</bundle>
    <bundle>mvn:org.jbpm/jbpm-query-jpa/${version.org.jbpm}</bundle>
    <bundle>mvn:org.jbpm/jbpm-audit/${version.org.jbpm}</bundle>
    <bundle>mvn:org.jbpm/jbpm-persistence-api/${version.org.jbpm}</bundle>
    <bundle>mvn:org.jbpm/jbpm-human-task-core/${version.org.jbpm}</bundle>
    <bundle>mvn:org.jbpm/jbpm-human-task-workitems/${version.org.jbpm}</bundle>
    <bundle>mvn:org.jbpm/jbpm-human-task-jpa/${version.org.jbpm}</bundle>
    <bundle>mvn:org.jbpm/jbpm-human-task-audit/${version.org.jbpm}</bundle>
  </feature>

  <feature name="jbpm" version="${project.version}" description="jBPM Engine">
    <feature version="${project.version}">drools-module</feature>
    <feature version="${project.version}">drools-jpa</feature>
    <feature version="${project.version}">jbpm-commons</feature>
    <feature version="${project.version}">jbpm-human-task</feature>
    <bundle>mvn:org.jbpm/jbpm-flow-builder/${version.org.jbpm}</bundle>
    <bundle>mvn:org.jbpm/jbpm-flow/${version.org.jbpm}</bundle>
    <bundle>mvn:org.jbpm/jbpm-bpmn2/${version.org.jbpm}</bundle>
    <bundle>mvn:org.jbpm/jbpm-audit/${version.org.jbpm}</bundle>
    <bundle>mvn:org.jbpm/jbpm-query-jpa/${version.org.jbpm}</bundle>
    <bundle>mvn:org.jbpm/jbpm-persistence-api/${version.org.jbpm}</bundle>
    <bundle>mvn:org.jbpm/jbpm-persistence-jpa/${version.org.jbpm}</bundle>
    <bundle>mvn:org.jbpm/jbpm-runtime-manager/${version.org.jbpm}</bundle>
    <bundle>mvn:org.apache.commons/commons-lang3/${version.org.apache.commons.lang3}</bundle>
  </feature>

  <feature name="optaplanner-engine" version="${project.version}" description="OptaPlanner Engine">
    <feature version="${project.version}">drools-module</feature>
    <bundle>mvn:org.optaplanner/optaplanner-core/${version.org.optaplanner}</bundle>
    <bundle>mvn:org.optaplanner/optaplanner-persistence-common/${version.org.optaplanner}</bundle>
    <bundle>mvn:org.optaplanner/optaplanner-persistence-xstream/${version.org.optaplanner}</bundle>
    <bundle>mvn:org.optaplanner/optaplanner-persistence-jaxb/${version.org.optaplanner}</bundle>
    <bundle>mvn:org.apache.commons/commons-lang3/${version.org.apache.commons.lang3}</bundle>
    <bundle>mvn:org.apache.commons/commons-math3/${version.org.apache.commons.math3}</bundle>
    <bundle>mvn:commons-io/commons-io/${version.commons-io}</bundle>
    <bundle>mvn:com.google.guava/guava/${version.com.google.guava}</bundle>
    <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.reflections/${karaf.version.org.apache.servicemix.bundles.reflections}</bundle>
  </feature>

  <feature name="droolsjbpm-hibernate" version="${version.org.hibernate}" description="Hibernate 5.x JPA persistence engine support">
    <details>Enable Hibernate 5.x as persistence engine.</details>
    <feature>transaction</feature>
    <feature>jpa</feature>
    <feature version="${project.version}">servlet-api-kie</feature>
    <bundle dependency="true">mvn:javax.persistence/javax.persistence-api/2.2</bundle>
    <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.antlr/${karaf.version.org.apache.servicemix.bundles.antlr}</bundle>
    <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ant/${karaf.version.org.apache.servicemix.bundles.ant}</bundle>
    <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/${karaf.version.org.apache.servicemix.bundles.dom4j}</bundle>
    <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/${karaf.version.org.apache.servicemix.bundles.serp}</bundle>
    <bundle dependency="true">mvn:com.fasterxml/classmate/${karaf.version.com.fasterxml.classmate}</bundle>
    <bundle dependency="true">mvn:org.javassist/javassist/${version.org.javassist}</bundle>
    <bundle dependency="true">mvn:net.bytebuddy/byte-buddy/${version.net.byte-buddy}</bundle>
    <bundle dependency="true">mvn:org.jboss.spec.javax.security.jacc/jboss-jacc-api_1.5_spec/${version.org.jboss.spec.javax.security.jacc.jboss-jacc-api_1.5_spec}</bundle>
    <bundle dependency="true">wrap:mvn:org.jboss/jandex/${karaf.version.org.jboss.jandex}</bundle>
    <bundle dependency="true">mvn:javax.validation/validation-api/${karaf.version.javax.validation}</bundle>
    <bundle dependency="true">mvn:org.jboss.logging/jboss-logging/${version.org.jboss.logging.jboss-logging}</bundle>
    <bundle dependency="true">mvn:org.hibernate.common/hibernate-commons-annotations/${version.org.hibernate.commons.annotations}</bundle>
    <bundle start-level="100">wrap:mvn:org.hibernate/hibernate-core/${version.org.hibernate}$overwrite=merge&amp;Import-Package=org.jbpm.services.task*,*</bundle>
    <bundle start-level="100">wrap:mvn:org.hibernate/hibernate-entitymanager/${version.org.hibernate}$overwrite=merge&amp;DynamicImport-Package=*</bundle>
    <bundle start-level="100">mvn:org.hibernate/hibernate-osgi/${version.org.hibernate}</bundle>
    <bundle start-level="100">mvn:org.apache.logging.log4j/log4j-api/${karaf.version.org.apache.logging.log4j}</bundle>
  </feature>

  <feature name="h2" version="${h2.version}" description="H2 database">
    <bundle>mvn:com.h2database/h2/${h2.version}</bundle>
    <bundle>mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/${karaf.version.org.apache.geronimo.specs.jta}</bundle>
    <bundle start-level="100">mvn:commons-dbcp/commons-dbcp/${version.commons-dbcp}</bundle>
    <bundle start-level="100">mvn:commons-pool/commons-pool/${version.commons-pool}</bundle>
  </feature>

  <feature name="kie-server-client" version="${project.version}" description="KIE Server Client">
    <feature version="${project.version}">drools-module</feature>
    <feature version="${project.version}">optaplanner-engine</feature>
    <bundle>mvn:org.kie.server/kie-server-api/${version.org.drools.droolsjbpm-integration}</bundle>
    <bundle>mvn:org.kie.server/kie-server-common/${version.org.drools.droolsjbpm-integration}</bundle>
    <bundle>mvn:org.kie.server/kie-server-client/${version.org.drools.droolsjbpm-integration}</bundle>
    <bundle>mvn:org.kie/kie-dmn-model/${version.org.kie}</bundle> <!-- needed as the kie-server contains DMN client, which uses the kie-dmn-api, which needs kie-dmn-model -->
    <bundle>mvn:org.kie/kie-dmn-api/${version.org.kie}</bundle>   <!-- needed as the kie-server contains DMN client, which uses the kie-dmn-api -->
    <bundle>mvn:org.drools/kie-pmml/${version.org.kie}</bundle>
    <bundle>wrap:mvn:org.jboss.spec.javax.ws.rs/jboss-jaxrs-api_2.0_spec/${version.org.jboss.spec.javax.ws.rs.jboss-jaxrs-api_2.0_spec}</bundle>
    <bundle>mvn:org.apache.commons/commons-lang3/${version.org.apache.commons.lang3}</bundle>
    <bundle>mvn:com.fasterxml.jackson.core/jackson-annotations/${version.com.fasterxml.jackson}</bundle>
    <bundle>mvn:com.fasterxml.jackson.core/jackson-core/${version.com.fasterxml.jackson}</bundle>
    <bundle>mvn:com.fasterxml.jackson.core/jackson-databind/${version.com.fasterxml.jackson}</bundle>
    <bundle>mvn:com.fasterxml.jackson.module/jackson-module-jaxb-annotations/${version.com.fasterxml.jackson}</bundle>
    <bundle>mvn:com.fasterxml.jackson.datatype/jackson-datatype-jsr310/${version.com.fasterxml.jackson}</bundle>
    <bundle>mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/${karaf.version.org.apache.geronimo.specs.jta}</bundle>
    <bundle>mvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/${karaf.version.org.apache.geronimo.specs.jms}</bundle>
    <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xpp3/${karaf.servicemix.version.com.thoughtworks.xmlpull}</bundle>
  </feature>

  <feature name="servlet-api-kie" version="${project.version}">
    <bundle>mvn:org.apache.geronimo.specs/geronimo-servlet_3.0_spec/${karaf.version.org.apache.geronimo.specs.servlet}</bundle>
  </feature>

  <feature name="kie-pmml" version="${project.version}">
    <feature version="${project.version}">drools-module</feature>
    <bundle start-level="100">mvn:org.drools/kie-pmml/${version.org.drools}</bundle>
  </feature>

</features>
