<?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>statefun-tsukuyomi-parent</artifactId>
    <groupId>group.insyde</groupId>
    <version>0.3.0</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>group.insyde</groupId>
  <artifactId>statefun-tsukuyomi-dispatcher</artifactId>
  <name>${project.groupId}:${project.artifactId}</name>
  <version>0.3.0</version>
  <description>Flink job that runs inside a Docker container and dispatches statefun-tsukuyomi messages</description>
  <url>https://github.com/4insyde/statefun-tsukuyomi</url>
  <developers>
    <developer>
      <name>Tymur Yarosh</name>
      <email>ti.yarosh@gmail.com</email>
      <organization>INSYDE Group</organization>
      <organizationUrl>https://github.com/4insyde</organizationUrl>
    </developer>
  </developers>
  <licenses>
    <license>
      <name>MIT License</name>
      <url>http://www.opensource.org/licenses/mit-license.php</url>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:git@github.com:4insyde/statefun-tsukuyomi.git</connection>
    <developerConnection>scm:git:git@github.com:4insyde/statefun-tsukuyomi.git</developerConnection>
    <url>https://github.com/4insyde/statefun-tsukuyomi</url>
  </scm>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <transformers>
                <transformer>
                  <mainClass>group.insyde.statefun.tsukuyomi.dispatcher.Runner</mainClass>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>io.fabric8</groupId>
        <artifactId>docker-maven-plugin</artifactId>
        <version>${docker-maven-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>build</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <filter>${*}</filter>
          <images>
            <image>
              <name>f1xman/${project.artifactId}:${project.version}</name>
              <build>
                <from>openjdk:11</from>
                <assembly>
                  <targetDir>/opt/statefun-tsukuyomi</targetDir>
                  <inline>
                    <files>
                      <file>
                        <source>${project.build.directory}/${project.artifactId}-${project.version}-shaded.jar</source>
                        <destName>${project.artifactId}.jar</destName>
                      </file>
                    </files>
                  </inline>
                </assembly>
                <cmd>
                  <shell>java -jar /opt/statefun-tsukuyomi/${project.artifactId}.jar</shell>
                </cmd>
              </build>
            </image>
          </images>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>1.18.22</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>5.8.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>junit-jupiter-api</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-jupiter-params</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-jupiter-engine</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>3.22.0</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>
  <properties>
    <scala.binary.version>2.12</scala.binary.version>
    <maven.compiler.target>11</maven.compiler.target>
    <maven.compiler.source>11</maven.compiler.source>
    <docker-maven-plugin.version>0.39.1</docker-maven-plugin.version>
    <flink.version>1.14.4</flink.version>
  </properties>
</project>
