<?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>pathling</artifactId>
    <groupId>au.csiro.pathling</groupId>
    <version>6.4.2</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>library-runtime</artifactId>
  <name>Pathling Library Runtime</name>
  <description>A Spark package that bundles the Pathling Library API and its runtime dependencies for cluster deployment.</description>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <configuration>
          <filesets>
            <fileset>
              <directory>${project.basedir}</directory>
              <includes>
                <include>dependency-reduced-pom.xml</include>
              </includes>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <createDependencyReducedPom>true</createDependencyReducedPom>
          <shadedArtifactAttached>false</shadedArtifactAttached>
          <useDependencyReducedPomInJar>true</useDependencyReducedPomInJar>
          <filters>
            <filter>
              <artifact>*:*</artifact>
              <excludes>
                <exclude>META-INF/MANIFEST.MF</exclude>
                <exclude>META-INF/versions/**</exclude>
              </excludes>
            </filter>
          </filters>
          <transformers>
            <transformer />
          </transformers>
          <relocations>
            <relocation>
              <pattern>com/</pattern>
              <shadedPattern>${shaded.dependency.prefix}.com.</shadedPattern>
              <includes>
                <include>com/github/benmanes/caffeine/**</include>
              </includes>
            </relocation>
            <relocation>
              <pattern>com/</pattern>
              <shadedPattern>${shaded.dependency.prefix}.com.</shadedPattern>
              <includes>
                <include>com/fasterxml/jackson/**</include>
              </includes>
            </relocation>
          </relocations>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>empty-sources</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classifier>sources</classifier>
            </configuration>
          </execution>
          <execution>
            <id>empty-javadoc</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classifier>javadoc</classifier>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <properties>
    <shaded.dependency.prefix>au.csiro.pathling.shaded</shaded.dependency.prefix>
  </properties>
</project>
