<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~~~~~~licensing~~~~~~
  platform
  ==========
  Copyright (C) 2020 - 2021 EmDev LLC
  ==========
  Licensed 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.
  ~~~~~~/licensing~~~~~~
  -->

<features name="entaxy-platform-${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">

    <repository>mvn:org.apache.camel.karaf/apache-camel/${camel.version}/xml/features</repository>
    <repository>mvn:org.apache.activemq/artemis-features/${activemq.version}/xml/features</repository>
    <repository>mvn:org.hibernate/hibernate-osgi/${hibernate.version}/xml/karaf</repository>
    <repository>mvn:org.apache.karaf.cellar/apache-karaf-cellar/${cellar.version}/xml/features</repository>
    <repository>mvn:org.apache.ignite/ignite-osgi-karaf/${ignite.version}/xml/features</repository>
	<repository>mvn:org.apache.karaf.features/enterprise/${karaf.version}/xml/features</repository>
	<repository>mvn:org.ops4j.pax.jdbc/pax-jdbc-features/1.4.4/xml/features</repository>
	<repository>mvn:org.apache.karaf.features/spring/4.2.9/xml/features</repository>
	<repository>mvn:org.apache.karaf.cave/apache-karaf-cave/${cave.version}/xml/features</repository>

	<!-- repository>mvn:ru.entaxy.esb/karaf-features/${project.version}/xml/features</repository -->
	
	<!-- underlying repos -->
	<repository>mvn:ru.entaxy.esb.underlying/entaxy-underlying-features/${project.version}/xml/features</repository>
	<!-- repository>mvn:ru.entaxy.esb.distribution/entaxy-karaf-kar/1.0-SNAPSHOT/xml/features</repository -->

	<!-- legacy repo -->
	<repository>mvn:ru.entaxy.esb.system/system-parent/${project.version}/xml/features</repository>
	
    <repository>mvn:ru.entaxy.esb.platform.runtime/base/${project.version}/xml/features</repository>
    <repository>mvn:ru.entaxy.esb.platform.runtime/core/${project.version}/xml/features</repository>
    <repository>mvn:ru.entaxy.esb.platform.runtime/modules/${project.version}/xml/features</repository>


    <feature name="entaxy-platform" version="${project.version}">

		<!-- Wait for all the startup features to be installed -->
		<feature>entaxy-underlying-configuration</feature>
		<feature>entaxy-karaf-basic</feature>
		<feature>entaxy-karaf-runtime</feature>


    	<!--  feature>maven-support</feature -->

    	<!-- bundle start-level="5" dependency="true">mvn:org.ops4j.pax.logging/pax-logging-api/1.11.6</bundle -->

    	<!-- then be sure all entaxy features needed are installed -->
    	<!-- feature>entaxy-karaf</feature -->
    	<feature>entaxy-legacy</feature>

		<!-- @TODO must be moved to base -->
    	<feature>entaxy-freemarker-support</feature>

		<feature version="${project.version}">entaxy-platform-components</feature>
		
		<!-- prepare for modules installation -->
		<feature version="${project.version}">entaxy-legacy-for-modules</feature>
		
		<feature version="${project.version}">entaxy-platform-modules-components</feature>

    </feature>

    <feature name="entaxy-karaf-basic" version="${project.version}">
		<feature>entaxy-underlying-configuration</feature>
		<feature>wrap</feature>
		<!-- feature>classpath</feature -->
		<feature>shell</feature>
		<feature>feature</feature>
		<feature>jaas</feature>
		<feature>ssh</feature>
		<feature>management</feature>
		<feature>bundle</feature>
		<feature>config</feature>
		<feature>deployer</feature>
		<feature>diagnostic</feature>
		<feature>feature</feature>
		<feature>instance</feature>
		<feature>kar</feature>
		<feature>log</feature>
		<feature>package</feature>
		<feature>service</feature>
		<feature>system</feature>
    </feature>

	<feature name="entaxy-karaf-healthcheck" version="${project.version}">
		<bundle>mvn:org.apache.felix/org.apache.felix.healthcheck.api/2.0.4</bundle>
		<bundle>mvn:org.apache.felix/org.apache.felix.healthcheck.core/2.0.12</bundle>
		<bundle>mvn:org.apache.felix/org.apache.felix.healthcheck.generalchecks/2.0.14</bundle>		
	</feature>

    <feature name="entaxy-karaf-runtime" version="${project.version}">
		<feature>entaxy-underlying-configuration</feature>
    	<feature>entaxy-karaf-basic</feature>
		<feature>scheduler</feature>
		<feature>eventadmin</feature>
		<feature>aries-blueprint</feature>

		<feature>entaxy-karaf-healthcheck</feature>

		<feature version="${cellar.version}">cellar</feature>
		<feature version="${cellar.version}">cellar-eventadmin</feature>
		<feature>cxf</feature>


		<feature>camel</feature>
		<feature>camel-blueprint</feature>
		<feature>camel-jaxb</feature>
		<feature>camel-cxf</feature>
		<feature>camel-amqp</feature>
		<feature>camel-core</feature>
		<feature>camel-http</feature>

		<feature>hibernate</feature>
		<feature>jdbc</feature>
		<feature>pax-jdbc-pool-dbcp2</feature>
		<feature>jndi</feature>

		<feature>camel-eventadmin</feature>
		<feature>camel-quartz</feature>
		<feature>camel-jsonpath</feature>
		<feature>camel-gson</feature>
		<feature>camel-ognl</feature>

		<feature>entaxy-karaf-commons-support</feature>
		<feature>entaxy-karaf-liquibase-support</feature>

		<feature>entaxy-karaf-artemis-jms-support</feature>
		<feature>artemis-jms-client</feature>
		<feature>camel-jms</feature>

		<!-- feature version="1.4.4">pax-jdbc-spec</feature>
		<feature version="1.4.4">pax-jdbc</feature>
		<feature version="1.4.4">pax-jdbc-config</feature>
		<feature version="4.2.9">jdbc</feature -->

		<feature version="${spring.bundles.version}">spring</feature>
		<feature version="${spring.bundles.version}">spring-tx</feature>
		<feature version="${spring.bundles.version}">spring-jdbc</feature>
		<feature version="[2,3)">jpa</feature>
		<!-- feature>entaxy-karaf-db-support</feature -->

		<feature>ignite-core</feature>
		<feature>entaxy-karaf-ignite-support</feature>
		<feature>camel-ignite</feature>
		<feature>camel-sql</feature>

		<feature>entaxy-karaf-jaxb-support</feature>

		<feature>cave-repository</feature>
		<feature>cave-repository-api</feature>

		<feature>wrapper</feature>
		<feature>shell-compat</feature>
		<feature>camel-jpa</feature>
		<feature>camel-jaxb</feature>
		<feature>camel-base64</feature>
		<feature>camel-zip-deflater</feature>
		<feature>camel-zipfile</feature>
    	<feature>entaxy-freemarker-support</feature>
	</feature>

    <feature name="entaxy-platform-components" version="${project.version}">
    	<feature>entaxy-karaf-basic</feature>
    	<feature>entaxy-karaf-runtime</feature>
    	<!-- feature>entaxy-karaf</feature -->
    	<feature>entaxy-legacy</feature>
    	<feature>entaxy-legacy-system</feature>
    	<!-- feature>karaf-camel-common</feature -->
    	<feature>entaxy-freemarker-support</feature>
    	
		<configfile finalname="${karaf.etc}/org.apache.felix.hc.generalchecks.BundlesStartedCheck-platform.cfg" override="true">
			mvn:ru.entaxy.esb/platform/${project.version}/cfg/org.apache.felix.hc.generalchecks.BundlesStartedCheck-platform
		</configfile> 

    	<!-- then install platform base & core -->
		<!-- bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.freemarker/2.3.29_1</bundle -->
		<feature version="${project.version}" dependency="false">entaxy-platform-base</feature>
		<feature version="${project.version}" dependency="false">entaxy-platform-core</feature>
    </feature>

	<feature name="entaxy-legacy-for-modules" version="${project.version}">
		<feature>entaxy-legacy</feature>
		<feature version="${project.version}">entaxy-platform-base</feature>
		<feature version="${project.version}">entaxy-platform-core</feature>
		<feature version="${project.version}">entaxy-platform-components</feature>

    	<!-- feature>entaxy-legacy-blueprint-generator</feature -->

		<feature>entaxy-legacy-system-api</feature>

    	<!-- feature>entaxy-legacy-deployer</feature -->
    	<feature>entaxy-legacy-profile-commons</feature>
    	<feature>entaxy-legacy-bundle-service</feature>
    	<feature>entaxy-legacy-connectors</feature>

		<feature>entaxy-legacy-management</feature>

    	<feature>entaxy-legacy-error-handler</feature>
        <feature>entaxy-legacy-system-profile</feature>
        
		<feature>entaxy-legacy-bridge-profiles</feature>

        <feature>entaxy-legacy-system-management</feature>
        
		<feature>entaxy-legacy-system-component</feature>

        <feature>entaxy-legacy-system-groups</feature>
        <feature>entaxy-legacy-permissions</feature>

		<feature>entaxy-legacy-management-connectors</feature>

        <feature>entaxy-legacy-events</feature>
        <!-- feature>entaxy-legacy-schema</feature -->
        <feature>entaxy-legacy-basic-auth</feature>

        <capability>
            osgi.service;objectClass=org.hibernate.SessionFactory;effective:=active;
        </capability>

	</feature>


	<feature name="entaxy-platform-modules-components" version="${project.version}">
		<feature version="${project.version}">entaxy-platform-base</feature>
		<feature version="${project.version}">entaxy-platform-core</feature>
		<feature version="${project.version}">entaxy-legacy-for-modules</feature>
		<!-- install platform modules -->
		<feature version="${project.version}">entaxy-platform-modules</feature>
	</feature>

    <!-- after the Cave repositories implemented move to entaxy-karaf -->
    <!-- feature name="maven-support" version="${project.version}">
		<bundle>mvn:org.eclipse.aether/aether-transport-http/1.1.0</bundle>
		<bundle>mvn:org.eclipse.aether/aether-transport-file/1.1.0</bundle>
		<bundle>mvn:org.eclipse.aether/aether-connector-basic/1.1.0</bundle>
		<bundle>mvn:org.eclipse.aether/aether-api/${aether.version}</bundle>
		<bundle>mvn:org.eclipse.aether/aether-impl/1.1.0</bundle>
		<bundle>wrap:mvn:org.apache.maven/maven-aether-provider/3.3.9</bundle>
    </feature -->

    <feature name="entaxy-legacy" version="${project.version}">
       	<feature>entaxy-karaf-basic</feature>
    	<feature>entaxy-karaf-runtime</feature>
        <configfile finalname="${karaf.etc}/ru.entaxy.esb.cfg" override="false">
            mvn:ru.entaxy.esb.system/system-parent/${project.version}/cfg/ru.entaxy.esb
        </configfile>
    	<feature>entaxy-legacy-main</feature>
    </feature>
    
</features>