<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2019 ABSA Group Limited
  ~
  ~ Licensed 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>za.co.absa.spline</groupId>
        <artifactId>parent-pom</artifactId>
        <version>0.8.2</version>
        <relativePath>../build/parent-pom/pom.xml</relativePath>
    </parent>

    <artifactId>admin</artifactId>
    <packaging>jar</packaging>

    <name>Spline Admin CLI</name>

    <properties>
        <dockerfile.imageName>spline-admin</dockerfile.imageName>
        <spline.cli.executable>java -jar ${project.build.finalName}.jar</spline.cli.executable>
    </properties>

    <dependencies>
        <dependency>
            <groupId>za.co.absa.spline</groupId>
            <artifactId>commons</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>za.co.absa.spline</groupId>
            <artifactId>persistence</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>za.co.absa.spline</groupId>
            <artifactId>producer-rest-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.github.scopt</groupId>
            <artifactId>scopt_${scala.compat.version}</artifactId>
        </dependency>
        <dependency>
            <groupId>org.backuity</groupId>
            <artifactId>ansi-interpolator_${scala.compat.version}</artifactId>
            <!-- the library is only used at compile time -->
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
        </dependency>

        <!-- test scope -->

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.3.0</version>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <appendAssemblyId>false</appendAssemblyId>
                    <archive>
                        <manifestEntries>
                            <Main-Class>za.co.absa.spline.admin.AdminCLI</Main-Class>
                            <Add-Opens>
                                <!--
                                --> java.base/java.util<!--
                                --> java.base/sun.nio.ch<!--
                                --> java.base/sun.nio.fs<!--
                                --> java.base/sun.net.www.protocol.jar<!--
                                -->
                            </Add-Opens>
                        </manifestEntries>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <configuration>
                    <skip>false</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>


</project>
