<?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 xmlns="http://karaf.apache.org/xmlns/features/v1.4.0"
          name="org.apache.brooklyn-1.0.0-M1"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:noNamespaceSchemaLocation="http://karaf.apache.org/xmlns/features/v1.4.0">

    <repository>mvn:org.apache.karaf.features/standard/4.1.2/xml/features</repository>
    <repository>mvn:org.apache.jclouds.karaf/jclouds-karaf/2.1.0/xml/features</repository>
    <repository>mvn:org.apache.cxf.karaf/apache-cxf/3.1.10/xml/features</repository>
    <repository>mvn:io.fabric8.kubernetes/kubernetes-karaf/1.4.27/xml/features</repository>

    <feature name="swagger" version="1.5.6" description="Swagger Annotations+Core+JAXRS+Models">
        <bundle dependency='true'>mvn:com.google.guava/guava/18.0</bundle>

        <bundle>mvn:io.swagger/swagger-annotations/1.5.6</bundle>
        <bundle>wrap:mvn:io.swagger/swagger-core/1.5.6</bundle>
        <bundle>wrap:mvn:io.swagger/swagger-jaxrs/1.5.6</bundle>
        <bundle>mvn:io.swagger/swagger-models/1.5.6</bundle>

        <bundle dependency='true'>mvn:com.fasterxml.jackson.core/jackson-annotations/2.9.6</bundle>
        <bundle dependency='true'>mvn:com.fasterxml.jackson.core/jackson-core/2.9.6</bundle>
        <bundle dependency='true'>mvn:com.fasterxml.jackson.core/jackson-databind/2.9.6</bundle>
        <bundle dependency='true'>mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-yaml/2.9.6</bundle>
        <bundle dependency='true'>mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-base/2.9.6</bundle>
        <bundle dependency='true'>mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/2.9.6</bundle>
    </feature>

    <feature name="brooklyn-utils-common" version="1.0.0-M1" description="Brooklyn Common Utils">
        <bundle>mvn:org.apache.brooklyn/brooklyn-utils-common/1.0.0-M1</bundle>
        <bundle>mvn:org.apache.brooklyn/brooklyn-logback-includes/1.0.0-M1</bundle>

        <bundle dependency="true">mvn:com.google.guava/guava/18.0</bundle>
        <bundle dependency="true">mvn:org.codehaus.groovy/groovy-all/2.4.15</bundle>
        <bundle dependency="true">mvn:commons-io/commons-io/2.4</bundle>
        <bundle dependency="true">mvn:commons-codec/commons-codec/1.9</bundle>
        <bundle dependency="true">mvn:org.slf4j/jul-to-slf4j/1.7.25</bundle>
        <bundle dependency="true">mvn:org.yaml/snakeyaml/1.22</bundle>
        <bundle dependency="true">mvn:org.apache.httpcomponents/httpcore-osgi/4.4.4</bundle>
        <bundle dependency="true">mvn:org.apache.httpcomponents/httpclient-osgi/4.5.2</bundle>

        <bundle dependency="true">mvn:ch.qos.logback/logback-classic/1.0.7</bundle>
        <bundle dependency="true">mvn:ch.qos.logback/logback-core/1.0.7</bundle>
    </feature>

    <feature name="brooklyn-utils-groovy" version="1.0.0-M1" description="Brooklyn Groovy Utils">
        <feature>brooklyn-utils-common</feature>
        <bundle>mvn:org.apache.brooklyn/brooklyn-utils-common/1.0.0-M1</bundle>
    </feature>

    <feature name="brooklyn-utils-rest-swagger" version="1.0.0-M1" description="Brooklyn REST Swagger Apidoc Utilities">
        <feature>brooklyn-utils-common</feature>
        <feature version="1.5.6">swagger</feature>

        <bundle>mvn:org.apache.brooklyn/brooklyn-utils-rest-swagger/1.0.0-M1</bundle>

        <bundle dependency="true">mvn:javax.servlet/javax.servlet-api/3.1.0</bundle>
        <bundle dependency="true">mvn:javax.ws.rs/javax.ws.rs-api/2.0.1</bundle>

        <!-- TODO: version 1.1.0.Final has OSGi manifest; check if upgrade doesn't get rid of wrap -->
        <bundle dependency="true">wrap:mvn:javax.validation/validation-api/1.1.0.Final</bundle>
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.reflections/0.9.9_1</bundle>
    </feature>

    <feature name="brooklyn-rest-api" version="1.0.0-M1" description="Brooklyn REST API">
        <feature>brooklyn-utils-rest-swagger</feature>
        <feature>brooklyn-api</feature>
        <feature>brooklyn-core</feature>

        <bundle>mvn:org.apache.brooklyn/brooklyn-rest-api/1.0.0-M1</bundle>

        <bundle dependency="true">mvn:org.jvnet.mimepull/mimepull/1.9.3</bundle>
        <bundle dependency="true">mvn:commons-lang/commons-lang/2.4</bundle>

        <!-- TODO: version 1.1.0.Final has OSGi manifest; check if upgrade doesn't get rid of wrap -->
        <bundle dependency="true">wrap:mvn:javax.validation/validation-api/1.1.0.Final</bundle>

        <bundle dependency="true">mvn:org.apache.commons/commons-lang3/3.3.2</bundle>
        <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-annotations/2.9.6</bundle>
        <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-databind/2.9.6</bundle>

        <bundle dependency="true">mvn:javax.servlet/javax.servlet-api/3.1.0</bundle>
    </feature>

    <feature name="brooklyn-rest-client" version="1.0.0-M1" description="Brooklyn REST Client">
        <feature>brooklyn-rest-api</feature>
        <feature>swagger</feature>
        
        <bundle>mvn:org.apache.brooklyn/brooklyn-rest-client/1.0.0-M1</bundle>
        
        <bundle dependency="true">mvn:org.apache.httpcomponents/httpclient-osgi/4.5.2</bundle>
        <bundle dependency='true'>mvn:commons-logging/commons-logging/1.2</bundle>
        <bundle dependency='true'>mvn:commons-codec/commons-codec/1.9</bundle>

        <bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jsr305/${jsr305.bundle.version}</bundle>
        <bundle dependency='true'>mvn:com.google.code.gson/gson/2.3</bundle>
        
        <bundle dependency='true'>wrap:mvn:javax.activation/activation/${javax-activation.version}</bundle>
        <bundle dependency="true">mvn:commons-io/commons-io/2.4</bundle>
        <bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jcip-annotations/${jcip-annotations.bundle.version}</bundle>
        
        <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-core/2.9.6</bundle>
        <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-annotations/2.9.6</bundle>
        <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-databind/2.9.6</bundle>
        <bundle dependency="true">mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/2.9.6</bundle>
        <bundle dependency='true'>mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-base/2.9.6</bundle>
        <bundle dependency="true">mvn:com.fasterxml.jackson.module/jackson-module-jaxb-annotations/2.9.6</bundle>
        <bundle dependency="true">mvn:com.fasterxml.jackson.datatype/jackson-datatype-guava/2.9.6</bundle>
    </feature>


    <feature name="brooklyn-api"  version="1.0.0-M1" description="Brooklyn API">
        <feature>brooklyn-utils-common</feature>
        <bundle>mvn:org.apache.brooklyn/brooklyn-api/1.0.0-M1</bundle>
    </feature>

    <feature name="brooklyn-core" version="1.0.0-M1" description="Brooklyn Core">
        <feature>brooklyn-api</feature>

        <bundle>mvn:org.apache.brooklyn/brooklyn-core/1.0.0-M1</bundle>
        <bundle>mvn:org.apache.brooklyn/brooklyn-utils-groovy/1.0.0-M1</bundle>

        <bundle dependency="true">mvn:com.google.code.gson/gson/2.3</bundle>
        <bundle dependency="true">mvn:com.jayway.jsonpath/json-path/2.4.0</bundle>
        <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-core/2.9.6</bundle>
        <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-databind/2.9.6</bundle>
        <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-annotations/2.9.6</bundle>
        <bundle dependency="true">mvn:net.minidev/json-smart/2.3</bundle>
        <bundle dependency="true">mvn:net.minidev/accessors-smart/1.2</bundle>
        <bundle dependency="true">mvn:com.thoughtworks.xstream/xstream/1.4.8</bundle>
        <bundle dependency="true">mvn:org.freemarker/freemarker/2.3.25-incubating</bundle>
        <bundle dependency="true">mvn:com.hierynomus/sshj/0.20.0</bundle>
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jzlib/1.1.3_2</bundle> <!-- jzlib version is 1.1.3, but bundle is 1.1.3_2 -->
        <bundle dependency="true">mvn:org.bouncycastle/bcprov-ext-jdk15on/1.51</bundle>
        <bundle dependency="true">mvn:org.bouncycastle/bcpkix-jdk15on/1.51</bundle>
        <bundle dependency="true">mvn:commons-codec/commons-codec/1.9</bundle>
        <bundle dependency="true">mvn:org.apache.commons/commons-lang3/3.3.2</bundle>
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xpp3/1.1.4c_7</bundle> <!-- from com.thoughtworks.xstream/xstream -->
        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.kxml2/2.3.0_3</bundle>

        <!-- TODO: don't use wrap -->
        <bundle dependency="true">wrap:mvn:com.maxmind.geoip2/geoip2/2.8.0-rc1</bundle> <!-- from geoip2 -->
        <bundle dependency="true">wrap:mvn:com.maxmind.db/maxmind-db/1.2.1</bundle>

        <bundle dependency="true">mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.reflections/0.9.9_1</bundle>
    </feature>

    <feature name="brooklyn-camp-brooklyn" version="1.0.0-M1" description="Brooklyn CAMP REST API">
        <bundle>mvn:org.apache.brooklyn/brooklyn-camp/1.0.0-M1</bundle>

        <feature>brooklyn-core</feature>
        <feature>brooklyn-camp-base</feature>
        <bundle dependency="true">mvn:commons-beanutils/commons-beanutils/1.9.3</bundle>
        <bundle dependency="true">mvn:commons-collections/commons-collections/3.2.2</bundle>
    </feature>

    <feature name="brooklyn-camp-base" version="1.0.0-M1" description="Brooklyn CAMP Base">
        <bundle>mvn:org.apache.brooklyn.camp/camp-base/1.0.0-M1</bundle>

        <feature>brooklyn-utils-common</feature>
        <bundle dependency="true">mvn:org.apache.commons/commons-compress/1.4</bundle>
        <bundle dependency="true">wrap:mvn:org.tukaani/xz/1.4</bundle>
        <bundle dependency="true">mvn:org.apache.commons/commons-lang3/3.3.2</bundle>
    </feature>

    <feature name="brooklyn-camp-server" version="1.0.0-M1" description="Brooklyn CAMP Server">
        <bundle>mvn:org.apache.brooklyn.camp/camp-server/1.0.0-M1</bundle>

        <feature>brooklyn-camp-base</feature>
        <feature>brooklyn-utils-rest-swagger</feature>
        <feature>pax-jetty</feature>
    </feature>

    <feature name="brooklyn-rest-resources-prereqs" version="1.0.0-M1" description="Brooklyn REST Resources Prerequisites">
        <feature>brooklyn-core</feature>
        <feature>brooklyn-rest-api</feature>
        <feature>brooklyn-camp-brooklyn</feature>
        <feature>brooklyn-camp-base</feature>

        <feature>cxf-jaxrs</feature>
        <bundle dependency="true">mvn:org.apache.cxf/cxf-rt-rs-security-cors/3.1.10</bundle>

        <bundle dependency="true">mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/2.9.6</bundle>

        <!-- should be deps of jax-rs-2.0 rest-api project -->
        <bundle dependency="true">mvn:javax.servlet/javax.servlet-api/3.1.0</bundle>
        <bundle dependency="true">mvn:javax.ws.rs/javax.ws.rs-api/2.0.1</bundle>

        <config name="org.apache.cxf.osgi">
            org.apache.cxf.servlet.context = /v1
        </config>
    </feature>

    <feature name="brooklyn-rest-resources" version="1.0.0-M1" description="Brooklyn REST Resources">
        <feature>brooklyn-rest-resources-prereqs</feature>
        <bundle>mvn:org.apache.brooklyn/brooklyn-rest-resources/1.0.0-M1</bundle>
    </feature>

    <feature name="brooklyn-commands"  version="1.0.0-M1"  description="Brooklyn Shell Commands">
        <bundle dependency="true">mvn:org.apache.brooklyn/brooklyn-launcher-common/1.0.0-M1</bundle>
        <bundle>mvn:org.apache.brooklyn/brooklyn-commands/1.0.0-M1</bundle>
    </feature>

    <feature name="brooklyn-software-winrm" version="1.0.0-M1" description="Brooklyn WinRM Software Entities">
        <bundle>mvn:org.apache.brooklyn/brooklyn-software-winrm/1.0.0-M1</bundle>
        <feature>brooklyn-core</feature>
        <bundle dependency="true">mvn:io.cloudsoft.windows/winrm4j/0.5.0</bundle>
        <bundle dependency="true">mvn:io.cloudsoft.windows/winrm4j-client/0.5.0</bundle>
        <bundle>mvn:org.apache.brooklyn/brooklyn-karaf-httpcomponents-extension/1.0.0-M1</bundle>
        <feature>cxf-jaxws</feature>
        <feature>cxf-http-async</feature>
        <feature>cxf-ws-addr</feature>
    </feature>

    <feature name="brooklyn-policy"  version="1.0.0-M1" description="Brooklyn Policies">
        <bundle>mvn:org.apache.brooklyn/brooklyn-policy/1.0.0-M1</bundle>
        <feature>brooklyn-core</feature>
    </feature>

    <feature name="brooklyn-software-base"  version="1.0.0-M1"  description="Brooklyn Software Base">
        <bundle>mvn:org.apache.brooklyn/brooklyn-software-base/1.0.0-M1</bundle>
        <bundle dependency="true">wrap:mvn:org.glassfish.external/opendmk_jmxremote_optional_jar/1.0-b01-ea$Import-Package=javax.management.openmbean,*</bundle>
        <feature>brooklyn-software-winrm</feature>
        <feature>brooklyn-policy</feature>
    </feature>

    <feature name="brooklyn-jmxmp-agent" version="1.0.0-M1" description="Brooklyn Secure JMXMP Agent">
        <bundle>mvn:org.apache.brooklyn/brooklyn-jmxmp-agent/1.0.0-M1</bundle>
        <feature>brooklyn-core</feature>
        <bundle dependency="true">wrap:mvn:org.glassfish.external/opendmk_jmxremote_optional_jar/1.0-b01-ea$Import-Package=javax.management.openmbean,*</bundle>
    </feature>

    <feature name="brooklyn-jmxrmi-agent" version="1.0.0-M1" description="Brooklyn JMX RMI Agent">
        <bundle>mvn:org.apache.brooklyn/brooklyn-jmxrmi-agent/1.0.0-M1</bundle>
    </feature>

    <feature name="brooklyn-locations-jclouds" version="1.0.0-M1" description="Brooklyn Jclouds Location Targets">
        <bundle>mvn:org.apache.jclouds/jclouds-loadbalancer/2.1.0</bundle>
        <feature>brooklyn-core</feature>
        <feature>jclouds-services</feature>
        <feature>jclouds-driver-sshj</feature>
        <feature>jclouds-driver-slf4j</feature>

        <!-- Same as allcompute -->
        <!-- As at jclouds 2.1.0 this pulls in snakeyaml 1.17 via jclouds-api-byon;
             I cannot see any way to prevent this, short of not using the jclouds feature
             definitions. Things we have tried include redeclaring that feature here
             with our preferred bundle and it works most places but at least one runtime
             (an RPM build of a downstream project installed to Docker) won't start as
             it seems to read the other feature definition.  We also tried the etc/overrides.properties
             but that did not prevent it from pulling in 1.17 at build, or if we built correctly,
             it did not prevent it from needing the 1.17 at runtime. Luckily having the two
             snakeyaml versions doesn't seem to be a problem. -->
        <feature>jclouds-all-compute</feature>
        <bundle dependency='true'>mvn:org.yaml/snakeyaml/1.17</bundle>

        <!-- Same as allblobstore -->
        <feature>jclouds-all-blobstore</feature>

        <bundle start-level="85">mvn:org.apache.brooklyn/brooklyn-locations-jclouds/1.0.0-M1</bundle>
        <feature>brooklyn-software-winrm</feature>
        <feature>brooklyn-locations-jclouds-labs</feature>
    </feature>

    <feature name="brooklyn-locations-jclouds-labs" version="1.0.0-M1" description="Brooklyn JClouds Labs Location Targets">
        <bundle>mvn:org.apache.jclouds.labs/azurecompute/2.1.0</bundle>
    </feature>

    <feature name="brooklyn-container-service" version="1.0.0-M1" description="Brooklyn Container Service and Location Targets">
        <bundle start-level="85">mvn:org.apache.brooklyn/brooklyn-locations-container/1.0.0-M1</bundle>

        <feature>brooklyn-core</feature>
        
<!-- the intention is to pull in these features to support deploy-to k8s 
        <feature>kubernetes-client</feature>
        <feature>openshift-client</feature>
     however they pull in incompatible versions - jackson 2.7.5 and snakeyaml 1.17 -
     so we declare instead the extra deps it declares, but skip those already pulled in.
     these two we skip because we pull them in elsewhere (same versions, but don't redeclare fixed version)
        <bundle dependency='true'>mvn:javax.validation/validation-api/1.1.0.Final</bundle>
        <bundle dependency='true'>mvn:javax.servlet/javax.servlet-api/3.1.0</bundle>
    these it declares at a different version, right version pulled in elsewhere
        <bundle dependency='true'>mvn:com.fasterxml.jackson.core/jackson-core/2.7.5</bundle>
        <bundle dependency='true'>mvn:com.fasterxml.jackson.core/jackson-annotations/2.7.5</bundle>
        <bundle dependency='true'>mvn:com.fasterxml.jackson.core/jackson-databind/2.7.5</bundle>
        <bundle dependency='true'>mvn:com.fasterxml.jackson.module/jackson-module-jaxb-annotations/2.7.5</bundle>
        <bundle dependency='true'>mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-base/2.7.5</bundle>
        <bundle dependency='true'>mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/2.7.5</bundle>
        <bundle dependency='true'>mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-yaml/2.7.5</bundle>
        <bundle dependency='true'>mvn:org.yaml/snakeyaml/1.17</bundle>
    these are needed:  -->
        <bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.generex/1.0.1_1</bundle>
        <bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.automaton/1.11-8_1</bundle>
<!-- 
    these are used elsewhere at different versions, but pull these versions also (OSGi will wire correctly): -->
        <bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.okio/1.9.0_1</bundle>
        <bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.okhttp/3.4.1_1</bundle>
<!--
    these are the main required bundles for the features above: -->
        <bundle>mvn:io.fabric8/kubernetes-model/1.0.64</bundle>
        <bundle>mvn:io.fabric8/zjsonpatch/0.2.3</bundle>
        <bundle>mvn:io.fabric8/kubernetes-client/1.4.27/jar/bundle</bundle>
        <bundle>mvn:io.fabric8/openshift-client/1.4.27/jar/bundle</bundle>
    </feature>

    <feature name="brooklyn-test-framework" version="1.0.0-M1" description="Brooklyn Test Framework" >
        <bundle>mvn:org.apache.brooklyn/brooklyn-test-framework/1.0.0-M1</bundle>
    </feature>

    <feature name="brooklyn-server-software-all" version="1.0.0-M1" description="Brooklyn All Core Entities">
        <feature>brooklyn-software-base</feature>
        <feature>brooklyn-jmxmp-agent</feature>
        <feature>brooklyn-jmxrmi-agent</feature>
        <feature>brooklyn-test-framework</feature>
    </feature>

    <feature name="brooklyn-osgi-launcher" version="1.0.0-M1" description="Brooklyn init">
        <feature>brooklyn-core</feature>
        <feature>brooklyn-server-software-all</feature>
        <feature>brooklyn-locations-jclouds</feature>
        <feature>brooklyn-container-service</feature>
        <bundle dependency="true">mvn:org.apache.brooklyn/brooklyn-launcher-common/1.0.0-M1</bundle>
        <bundle start-level="90">mvn:org.apache.brooklyn/brooklyn-karaf-init/1.0.0-M1</bundle>
        <bundle start-level="90">mvn:org.apache.brooklyn/brooklyn-karaf-start/1.0.0-M1</bundle>
    </feature>

</features>
