
<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">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>be.fluid-it.microservice.bundle</groupId>
    <artifactId>microservice-bundle-showcase-delivery</artifactId>
    <version>0.1-9</version>
    <relativePath>../frozen.pom.xml</relativePath>
  </parent>
  <artifactId>microservice-bundle-showcase-capsule</artifactId>
  <version>0.1-9</version>
  <packaging>jar</packaging>
  <name>microservice-bundle-showcase-capsule</name>
  <description>Showcase application utilizing the microservice bundle packaged as a capsule.</description>
  <properties>
    <capsule.version>1.0</capsule.version>
    <capsule.maven.plugin.version>1.0.0</capsule.maven.plugin.version>
    <docker.maven.plugin.version>0.3.9</docker.maven.plugin.version>
    <revision>1</revision>
    <docker.registry>
    </docker.registry>
    <push.image>false</push.image>
  </properties>
  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>microservice-bundle-showcase</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>microservice-bundle-showcase-cfg</artifactId>
      <version>${project.version}</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>com.github.chrischristo</groupId>
        <artifactId>capsule-maven-plugin</artifactId>
        <version>${capsule.maven.plugin.version}</version>
        <configuration>
          <appClass>be.fluid_it.µs.bundle.showcase.app.HelloService</appClass>
          <types>fat</types>
          <manifest>
            <entry>
              <key>Allow-Snapshots</key>
              <value>true</value>
            </entry>
          </manifest>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.spotify</groupId>
        <artifactId>docker-maven-plugin</artifactId>
        <version>${docker.maven.plugin.version}</version>
        <configuration>
          <imageName>${docker.registry}docx-merge:${revision}</imageName>
          <pushImage>${push.image}</pushImage>
          <baseImage>java</baseImage>
          <entryPoint>["java", "-jar", "/${project.build.finalName}-capsule-fat.jar"]</entryPoint>
          <resources>
            <resource>
              <targetPath>/</targetPath>
              <directory>${project.build.directory}</directory>
              <include>${project.build.finalName}-capsule-fat.jar</include>
            </resource>
          </resources>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>capsule</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.chrischristo</groupId>
            <artifactId>capsule-maven-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>build</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>executable-capsule</id>
      <activation>
        <os>
          <family>unix</family>
        </os>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.github.chrischristo</groupId>
            <artifactId>capsule-maven-plugin</artifactId>
            <configuration>
              <chmod>true</chmod>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>docker</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.spotify</groupId>
            <artifactId>docker-maven-plugin</artifactId>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>build</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>