<?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.brooklyn.ui/brooklyn-ui-features/1.0.0-M1/xml/features</repository>

    <feature name="brooklyn-standard-karaf" version="1.0.0-M1" description="Karaf standard feature with RMI excluded">
        <feature>wrap</feature>
        <feature>aries-blueprint</feature>
        <feature>shell</feature>
        <feature>shell-compat</feature>
        <feature>feature</feature>
        <feature>jaas</feature>
        <feature>ssh</feature>
        <!-- Don't load the feature as it opens ports protected by the default credentials -->
        <!-- Could alternatively reconfigure the feature to use more restricted realm, but we don't use this functionality anyway. -->
        <!-- 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>
        <!-- load BouncyCastle early, to avoid refreshing of org.apache.sshd.core/0.14.0 later -->
        <bundle dependency="true">mvn:org.bouncycastle/bcprov-ext-jdk15on/1.51</bundle>
        <bundle dependency="true">mvn:org.bouncycastle/bcpkix-jdk15on/1.51</bundle>
    </feature>

    <feature name="brooklyn-startup-features" version="1.0.0-M1" description="Bundles to add to startup.properties">
        <!-- Register javax.mail along with pax-logging-service so it doesn't get refreshed later -->
        <bundle>mvn:javax.mail/mail/1.4.4</bundle>
    </feature>

    <feature name="brooklyn-guava-optional-deps" version="1.0.0-M1" description="Guava dependencies to avoid refreshing the bundle">
        <!-- Register javax.annotation (coming from cxf-jaxrs) before guava so it doesn't get rewired when it sees it -->
        <bundle>mvn:javax.annotation/javax.annotation-api/1.2</bundle>
    </feature>

    <feature name="brooklyn-config" version="1.0.0-M1">
        <configfile finalname="${karaf.etc}/org.apache.brooklyn.classrename.cfg" override="false">
            mvn:org.apache.brooklyn/brooklyn-dist-config/1.0.0-M1/cfg/classrename
        </configfile>
        <configfile finalname="${karaf.etc}/org.apache.brooklyn.osgilauncher.cfg" override="false">
            mvn:org.apache.brooklyn/brooklyn-dist-config/1.0.0-M1/cfg/osgilauncher
        </configfile>
    </feature>

    <feature name="brooklyn-catalog" version="1.0.0-M1">
        <configfile finalname="${karaf.home}/catalog/catalog.bom" override="false">
            mvn:org.apache.brooklyn/brooklyn-dist-config/1.0.0-M1/bom/catalog
        </configfile>
        <configfile finalname="${karaf.home}/catalog/catalog-core.bom" override="false">
            mvn:org.apache.brooklyn/brooklyn-dist-config/1.0.0-M1/bom/catalog-core
        </configfile>
        <configfile finalname="${karaf.home}/catalog/catalog-templates.bom" override="false">
            mvn:org.apache.brooklyn/brooklyn-dist-config/1.0.0-M1/bom/catalog-templates
        </configfile>
    </feature>

    <feature name="brooklyn-headless" version="1.0.0-M1" description="All Brooklyn bundles witht the exception of the launcher">
        <feature prerequisite="true">brooklyn-config</feature>
        <feature prerequisite="true">brooklyn-catalog</feature>
        <feature prerequisite="true">brooklyn-standard-karaf</feature>
        <feature prerequisite="true">brooklyn-guava-optional-deps</feature>
        <feature>brooklyn-core</feature>
        <feature>brooklyn-locations-jclouds</feature>
        <feature>brooklyn-commands</feature>
        <feature>brooklyn-server-software-all</feature>
        <feature>brooklyn-library-all</feature>
        <feature>brooklyn-rest-resources-prereqs</feature>
        <feature>brooklyn-jsgui-prereqs</feature>
    </feature>

    <feature name="brooklyn-jsgui-prereqs" version="1.0.0-M1" description="Brooklyn REST JavaScript Web GUI">
        <feature>pax-jetty</feature> <!-- jaas bundle -->
        <feature>war</feature>
    </feature>

    <feature name="brooklyn-jsgui" version="1.0.0-M1" description="Brooklyn REST JavaScript Web GUI">
        <feature>brooklyn-jsgui-prereqs</feature>
        <feature>brooklyn-ui</feature>
    </feature>

    <feature name="brooklyn-boot" version="1.0.0-M1" description="Bundles to start on boot">
        <feature prerequisite="true">brooklyn-headless</feature>
        <bundle>mvn:org.apache.brooklyn/brooklyn-karaf-jetty-config/1.0.0-M1</bundle>
        <feature>brooklyn-osgi-launcher</feature>
        <feature>brooklyn-jsgui</feature>
        <feature>brooklyn-rest-resources</feature>
    </feature>

</features>
