<?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.examples</groupId>
        <artifactId>karaf-docker-example</artifactId>
        <version>4.2.15-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>karaf-docker-example-dynamic-dist</artifactId>
    <name>Apache Karaf :: Examples :: Docker :: Dynamic Distribution</name>
    <packaging>pom</packaging>

    <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.apache.karaf.features</groupId>
            <artifactId>framework</artifactId>
            <type>kar</type>
        </dependency>

        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>framework</artifactId>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>standard</artifactId>
            <classifier>features</classifier>
            <type>xml</type>
        </dependency>

        <dependency>
            <groupId>org.apache.karaf.examples</groupId>
            <artifactId>karaf-docker-example-app</artifactId>
            <type>xml</type>
            <classifier>features</classifier>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>karaf-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>process-resources</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>assembly</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>package</id>
                        <goals>
                            <goal>archive</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>dockerfile</id>
                        <goals>
                            <goal>dockerfile</goal>
                        </goals>
                        <configuration>
                            <command>["karaf"]</command>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <installedFeatures>
                        <feature>wrapper</feature>
                        <feature>aries-blueprint</feature>
                        <feature>shell-compat</feature>
                    </installedFeatures>
                    <startupFeatures>
                        <feature>eventadmin</feature>
                    </startupFeatures>
                    <bootFeatures>
                        <feature>wrap</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>scr</feature>
                        <feature>http-whiteboard</feature>
                        <feature>karaf-docker-example-app</feature>
                    </bootFeatures>
                    <libraries>
                    </libraries>
                    <javase>1.8</javase>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>docker</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.karaf.tooling</groupId>
                        <artifactId>karaf-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>docker-image</id>
                                <goals>
                                    <goal>docker</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <imageName>${project.artifactId}</imageName>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>test</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.karaf.tooling</groupId>
                        <artifactId>karaf-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>process-resources</id>
                                <phase>none</phase>
                            </execution>
                            <execution>
                                <id>package</id>
                                <phase>none</phase>
                            </execution>
                            <execution>
                                <id>dockerfile</id>
                                <phase>none</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>