<?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">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.jboss.pnc.bacon</groupId>
        <artifactId>parent</artifactId>
        <version>2.2.0</version>
    </parent>

    <artifactId>cli</artifactId>

    <dependencies>
        <dependency>
            <groupId>org.jboss.pnc.bacon</groupId>
            <artifactId>common</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.pnc.bacon</groupId>
            <artifactId>da</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.pnc.bacon</groupId>
            <artifactId>pnc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.pnc.bacon</groupId>
            <artifactId>pig</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.pnc</groupId>
            <artifactId>rest-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
        <dependency>
            <groupId>info.picocli</groupId>
            <artifactId>picocli</artifactId>
        </dependency>
        <dependency>
            <groupId>info.picocli</groupId>
            <artifactId>picocli-shell-jline3</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jline</groupId>
            <artifactId>jline</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jline</groupId>
            <artifactId>jline-console</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
        </dependency>
        <dependency>
            <groupId>org.fusesource.jansi</groupId>
            <artifactId>jansi</artifactId>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.stefanbirkner</groupId>
            <artifactId>system-lambda</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <id>shade-for-licenses-to-work</id>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <finalName>bacon</finalName>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <manifestEntries>
                                        <Implementation-Version>${project.version}</Implementation-Version>
                                    </manifestEntries>
                                    <mainClass>org.jboss.pnc.bacon.cli.App</mainClass>
                                </transformer>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ComponentsXmlResourceTransformer" />
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                    <resource>META-INF/sisu/javax.inject.Named</resource>
                                </transformer>
                            </transformers>
                            <createDependencyReducedPom>true</createDependencyReducedPom>
                            <!-- If we're deploying this we should have a different classifier -->
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <shadedClassifierName>shaded</shadedClassifierName>
                            <!-- We don't want the signing stuff, this can be disabled with maven also -->
                            <filters>
                                <filter>
                                    <artifact>*:*</artifact>
                                    <excludes>
                                        <exclude>META-INF/*.SF</exclude>
                                        <exclude>META-INF/*.DSA</exclude>
                                        <exclude>META-INF/*.RSA</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>python-test</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>test</phase>
                        <configuration>
                            <workingDirectory>${project.parent.basedir}</workingDirectory>
                            <executable>python3</executable>
                            <arguments>
                                <argument>-m</argument>
                                <argument>unittest</argument>
                                <argument>bacon_test</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
