<?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>parent</artifactId>
    <groupId>io.staminaframework.runtime</groupId>
    <version>0.1.0</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>io.staminaframework.runtime.launcher</artifactId>
  <name>Stamina Runtime Launcher</name>
  <url>http://staminaframework.io/${project.artifactId}</url>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>shade-jar</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <artifactSet>
            <includes>
              <include>*:org.apache.felix.utils</include>
            </includes>
          </artifactSet>
          <filters>
            <filter>
              <artifact>*:org.apache.felix.utils</artifact>
              <includes>
                <include>org/apache/felix/utils/properties/**</include>
                <include>org/apache/felix/utils/manifest/**</include>
              </includes>
            </filter>
          </filters>
          <relocations>
            <relocation>
              <pattern>org.apache.felix.utils.properties</pattern>
              <shadedPattern>io.staminaframework.runtime.launcher.properties</shadedPattern>
            </relocation>
            <relocation>
              <pattern>org.apache.felix.utils.manifest</pattern>
              <shadedPattern>io.staminaframework.runtime.launcher.manifest</shadedPattern>
            </relocation>
          </relocations>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.0.2</version>
        <executions>
          <execution>
            <id>generate-java-sources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/generated-sources/version</outputDirectory>
              <resources>
                <resource>
                  <filtering>true</filtering>
                  <directory>${project.basedir}/src/main/java-templates</directory>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <id>add-generated-sources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/generated-sources/version</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <mainClass>io.staminaframework.runtime.launcher.Main</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.apache.felix.framework</artifactId>
      <version>5.6.10</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
</project>

