<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
    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.
-->
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.apache.sling</groupId>
        <artifactId>sling</artifactId>
        <version>35</version>
        <relativePath />
    </parent>

    <artifactId>org.apache.sling.kickstart</artifactId>
    <version>0.0.2</version>
    <packaging>slingkickstart</packaging>

    <name>Apache Sling Kickstart Launcher</name>
    <description>
        Creates an Executable JAR file to launch Sling Feature Model Project
    </description>

    <scm>
        <connection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-kickstart.git</connection>
        <developerConnection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-kickstart.git</developerConnection>
        <url>https://gitbox.apache.org/repos/asf?p=sling-org-apache-sling-kickstart.git</url>
        <tag>org.apache.sling.kickstart-0.0.2</tag>
    </scm>

    <properties>
        <sling.java.version>8</sling.java.version>

        <sling-kickstart-maven-plugin.version>0.0.2</sling-kickstart-maven-plugin.version>

        <picocli.version>3.9.6</picocli.version>
        <org.apache.sling.feature.launcher.version>1.1.2</org.apache.sling.feature.launcher.version>
        <org.apache.sling.feature.extension.content.version>1.0.6</org.apache.sling.feature.extension.content.version>
        <org.apache.felix.framework.version>6.0.3</org.apache.felix.framework.version>
        <commons-io.version>2.6</commons-io.version>
        <commons-lang.version>2.6</commons-lang.version>
        <osgi.core.version>7.0.0</osgi.core.version>

        <org.apache.felix.utils.version>1.11.2</org.apache.felix.utils.version>
        <httpclient.version>4.5.10</httpclient.version>

        <IT.expected.bundles.count>126</IT.expected.bundles.count>
        <block.sling.at.the.end>false</block.sling.at.the.end>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>ianal-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>verify-legal-files</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${basedir}</directory>
                            <includes>
                                <include>sling/**</include>
                                <include>coverage.ec</include>
                            </includes>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack-dependencies</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <excludes>META-INF/**</excludes>
                            <outputDirectory>${project.build.directory}/classes</outputDirectory>
                            <overWriteReleases>false</overWriteReleases>
                            <overWriteSnapshots>true</overWriteSnapshots>
                            <includeArtifactIds>
                                commons-io,
                                org.apache.sling.feature.extension.content,
                                org.apache.sling.feature.launcher,
                                osgi.core,commons-lang,
                                org.apache.sling.feature,
                                org.apache.sling.feature.io,
                                org.apache.felix.converter,
                                picocli,
                                slf4j-api,
                                slf4j-simple
                            </includeArtifactIds>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>org.apache.sling.kickstart.app.KickstartStarter</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.rat</groupId>
                <artifactId>apache-rat-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>readme.md</exclude>
                        <exclude>src/main/resources/META-INF/services/**</exclude>
                        <exclude>**/*.properties</exclude>
                        <exclude>launcher/**</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>reserve-network-port</id>
                        <goals>
                            <!-- pre-integration-test is too late -->
                            <goal>reserve-network-port</goal>
                        </goals>
                        <phase>process-resources</phase>
                        <configuration>
                            <portNames>
                                <portName>http.port</portName>
                                <portName>sling.control.port</portName>
                            </portNames>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.sling</groupId>
                <artifactId>sling-kickstart-maven-plugin</artifactId>
                <version>${sling-kickstart-maven-plugin.version}</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>start-container-before-IT</id>
                        <goals>
                            <goal>start</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <launchpadJar>${project.build.directory}/${project.artifactId}-${project.version}.jar</launchpadJar>
                    <parallelExecution>false</parallelExecution>
                    <servers>
                        <server>
                            <port>${http.port}</port>
                            <controlPort>${sling.control.port}</controlPort>
                            <debug>true</debug>
                        </server>
                    </servers>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <systemPropertyVariables>
                        <launchpad.http.port>${http.port}</launchpad.http.port>
                        <IT.expected.bundles.count>${IT.expected.bundles.count}</IT.expected.bundles.count>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <!-- Extend RAT configuration from parent pom -->
                    <groupId>org.apache.rat</groupId>
                    <artifactId>apache-rat-plugin</artifactId>
                    <configuration>
                        <excludes combine.children="append">
                            <!-- Exclude sling instance -->
                            <exclude>sling/**</exclude>
                        </excludes>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencies>
        <!--
         | CLI
        -->
        <dependency>
            <groupId>info.picocli</groupId>
            <artifactId>picocli</artifactId>
            <version>${picocli.version}</version>
        </dependency>

        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>${commons-lang.version}</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons-io.version}</version>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>osgi.core</artifactId>
            <version>${osgi.core.version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.framework</artifactId>
            <version>${org.apache.felix.framework.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.feature.extension.content</artifactId>
            <version>${org.apache.sling.feature.extension.content.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.feature.launcher</artifactId>
            <version>${org.apache.sling.feature.launcher.version}</version>
        </dependency>

        <!-- Testing dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>${httpclient.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.utils</artifactId>
            <version>${org.apache.felix.utils.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
