<?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/maven-v4_0_0.xsd">
  <parent>
    <artifactId>lutra</artifactId>
    <groupId>xyz.ottr.lutra</groupId>
    <version>0.6.9</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>lutra-cli</artifactId>
  <name>${project.groupId}:${project.artifactId}</name>
  <build>
    <plugins>
      <plugin>
        <groupId>com.googlecode.maven-download-plugin</groupId>
        <artifactId>download-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>download-pottr</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>wget</goal>
            </goals>
            <configuration>
              <unpack>true</unpack>
              <url>https://primer.ottr.xyz/master.zip</url>
              <outputFileName>master.zip</outputFileName>
              <outputDirectory>${project.basedir}/src/test/resources/primer</outputDirectory>
              <skipCache>true</skipCache>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <shadedArtifactAttached>false</shadedArtifactAttached>
          <transformers>
            <transformer>
              <mainClass>xyz.ottr.lutra.cli.CLI</mainClass>
            </transformer>
            <transformer />
            <transformer />
            <transformer>
              <addHeader>false</addHeader>
            </transformer>
          </transformers>
          <filters>
            <filter>
              <artifact>*:*</artifact>
              <excludes>
                <exclude>META-INF/*.SF</exclude>
                <exclude>META-INF/*.DSA</exclude>
                <exclude>META-INF/*.RSA</exclude>
              </excludes>
            </filter>
          </filters>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.coderplus.maven.plugins</groupId>
        <artifactId>copy-rename-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>rename-lutra-target</id>
            <phase>package</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <sourceFile>${project.build.directory}/${project.build.finalName}.jar</sourceFile>
              <destinationFile>${project.build.directory}/lutra.jar</destinationFile>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>1.18.16</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.1</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>annotations</artifactId>
      <version>3.0.1u2</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
</project>
