<?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>
    <artifactId>beekeeper-package</artifactId>
    <groupId>com.expediagroup</groupId>
    <version>2.1.0</version>
  </parent>

  <artifactId>beekeeper-assembly-cleanup</artifactId>
  <packaging>pom</packaging>

  <properties>
    <docker.port>8008</docker.port>
    <dockerfile-maven-plugin.version>1.4.10</dockerfile-maven-plugin.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.expediagroup</groupId>
      <artifactId>beekeeper-cleanup</artifactId>
      <version>${project.version}</version>
      <classifier>spring-boot</classifier>
    </dependency>
  </dependencies>

  <build>
    <finalName>beekeeper-cleanup-${project.version}</finalName>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>${maven.assembly.plugin.version}</version>
        <executions>
          <execution>
            <id>make-zip-cleanup</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <tarLongFileMode>posix</tarLongFileMode>
              <descriptors>
                <descriptor>src/main/assembly/beekeeper-assembly-cleanup.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.spotify</groupId>
        <artifactId>dockerfile-maven-plugin</artifactId>
        <version>${dockerfile-maven-plugin.version}</version>
        <executions>
          <execution>
            <id>tag-cleanup</id>
            <phase>deploy</phase>
            <goals>
              <goal>build</goal>
              <goal>tag</goal>
            </goals>
            <configuration>
              <tag>${project.version}</tag>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <dockerfile>${dockerfile.path}</dockerfile>
          <repository>${docker.registry}/beekeeper-cleanup</repository>
          <buildArgs>
            <BEEKEEPER_VERSION>${project.version}</BEEKEEPER_VERSION>
            <PORT>${docker.port}</PORT>
          </buildArgs>
          <useMavenSettingsForAuth>true</useMavenSettingsForAuth>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
