<?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>platform</artifactId>
    <groupId>com.proofpoint.platform</groupId>
    <version>2.88</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>launcher</artifactId>
  <name>launcher</name>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <createSourcesJar>true</createSourcesJar>
              <shadeSourcesContent>true</shadeSourcesContent>
              <artifactSet>
                <includes>
                  <include>com.github.jnr:jnr-posix</include>
                  <include>com.github.jnr:jnr-constants</include>
                  <include>com.github.jnr:jnr-ffi</include>
                  <include>com.github.jnr:jnr-x86asm</include>
                  <include>com.github.jnr:jffi</include>
                  <include>org.ow2.asm:asm</include>
                  <include>org.ow2.asm:asm-commons</include>
                  <include>org.ow2.asm:asm-analysis</include>
                  <include>org.ow2.asm:asm-tree</include>
                  <include>org.ow2.asm:asm-util</include>
                </includes>
              </artifactSet>
              <relocations>
                <relocation>
                  <pattern>jnr</pattern>
                  <shadedPattern>${shadeBase}.jnr</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>jni</pattern>
                  <shadedPattern>${shadeBase}.jni</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.kenai</pattern>
                  <shadedPattern>${shadeBase}.kenai</shadedPattern>
                  <excludes>
                    <exclude>com.kenai.jffi.**</exclude>
                  </excludes>
                </relocation>
                <relocation>
                  <pattern>org.objectweb.asm</pattern>
                  <shadedPattern>${shadeBase}.asm</shadedPattern>
                </relocation>
              </relocations>
              <filters>
                <filter>
                  <artifact>com.github.jnr:jnr-posix</artifact>
                  <excludes>
                    <exclude>META-INF/maven/**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>com.github.jnr:jnr-constants</artifact>
                  <excludes>
                    <exclude>META-INF/maven/**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>com.github.jnr:jnr-ffi</artifact>
                  <excludes>
                    <exclude>META-INF/maven/**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>com.github.jnr:jnr-x86asm</artifact>
                  <excludes>
                    <exclude>META-INF/maven/**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>com.github.jnr:jffi</artifact>
                  <excludes>
                    <exclude>META-INF/maven/**</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <configuration>
          <filesets>
            <fileset>
              <directory>${basedir}</directory>
              <includes>
                <include>dependency-reduced-pom.xml</include>
              </includes>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <mainClass>com.proofpoint.launcher.Main</mainClass>
              <addClasspath>true</addClasspath>
              <useUniqueVersions>false</useUniqueVersions>
            </manifest>
            <manifestEntries>
              <Implementation-Version>${project.version}</Implementation-Version>
              <Class-Path>main.jar</Class-Path>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>package-tgz</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>src/main/assemblies/packaging.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>com.proofpoint.platform</groupId>
      <artifactId>configuration</artifactId>
      <version>2.88</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.github.spotbugs</groupId>
      <artifactId>spotbugs-annotations</artifactId>
      <version>4.7.0</version>
      <scope>compile</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>io.airlift</groupId>
      <artifactId>airline</artifactId>
      <version>0.4</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
  <properties>
    <shadeBase>com.proofpoint.launcher.internal</shadeBase>
  </properties>
</project>
