<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <!--

        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.
    -->

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.apache.karaf.shell</groupId>
        <artifactId>shell</artifactId>
        <version>4.3.4-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>org.apache.karaf.shell.core</artifactId>
    <packaging>bundle</packaging>
    <name>Apache Karaf :: Shell :: Core</name>
    <description>This bundle provides OSGi shell integration and console support.</description>

    <properties>
        <appendedResourcesDirectory>${basedir}/../../etc/appended-resources</appendedResourcesDirectory>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.karaf</groupId>
                <artifactId>karaf-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jline</groupId>
            <artifactId>jline</artifactId>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>osgi.core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>osgi.cmpn</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.karaf.jaas</groupId>
            <artifactId>org.apache.karaf.jaas.boot</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.gogo.runtime</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.gogo.jline</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.utils</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.karaf</groupId>
            <artifactId>org.apache.karaf.util</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sshd</groupId>
            <artifactId>sshd-osgi</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.karaf.service</groupId>
            <artifactId>org.apache.karaf.service.guard</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>${project.basedir}/../../client/src/main/key</directory>
                <filtering>false</filtering>
            </resource>
            <resource>
                <directory>${project.basedir}/src/main/resources</directory>
                <includes>
                    <include>**/*</include>
                </includes>
            </resource>
            <resource>
                <directory>${project.basedir}/src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/*.info</include>
                </includes>
            </resource>
            <resource>
                <directory>${project.basedir}/src/main/filtered-resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/*</include>
                </includes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <configuration>
                    <mainClass>Main</mainClass>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <instructions>
                        <Import-Package>
                            org.osgi.service.event;resolution:=optional,
                            org.apache.karaf.branding;resolution:=optional,
                            !org.apache.felix.gogo.jline*,
                            !org.apache.sshd.*,
                            org.osgi.framework;version="[1,3)",
                            *
                        </Import-Package>
                        <Export-Package>
                            org.apache.karaf.shell.api.*;version=${project.version},
                            org.apache.karaf.shell.support.*;version=${project.version},
                            org.apache.felix.service.command,
                            org.apache.felix.service.threadio
                        </Export-Package>
                        <Private-Package>
                            org.apache.karaf.service.guard.tools,
                            org.apache.karaf.shell.impl.*,
                            org.apache.karaf.util,
                            org.apache.karaf.util.filesstream,
                            org.apache.karaf.util.jaas,
                            org.apache.karaf.util.tracker,
                            org.apache.felix.utils.properties,
                            org.apache.felix.utils.extender,
                            org.apache.felix.utils.manifest,
                            org.apache.felix.gogo.jline,
                            org.apache.felix.gogo.runtime,
                            org.apache.felix.gogo.runtime.util,
                            org.apache.felix.gogo.runtime.util.function,
                            org.apache.felix.gogo.runtime.threadio,
                            org.apache.felix.service.command,
                            org.apache.felix.service.threadio,
                        </Private-Package>
                        <Provide-Capability>
                            osgi.service;effective:=active;objectClass=org.apache.karaf.shell.api.console.SessionFactory,
                            org.apache.felix.gogo;org.apache.felix.gogo=command.implementation;version:Version="1.0.0"
                        </Provide-Capability>
                        <Bundle-Activator>
                            org.apache.karaf.shell.impl.console.osgi.Activator
                        </Bundle-Activator>
                        <Main-Class>
                            org.apache.karaf.shell.impl.console.standalone.Main
                        </Main-Class>
                    </instructions>
                    <unpackBundle>true</unpackBundle>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
