<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.jboss.windup</groupId>
        <artifactId>windup-parent</artifactId>
        <version>6.1.0.Final</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <artifactId>gremlin-shaded</artifactId>
    <name>Fork of Apache TinkerPop :: Gremlin Shaded</name>

    <!--
    added to replace the lack of gremlin-shaded
    based upon https://repo1.maven.org/maven2/org/apache/tinkerpop/gremlin-shaded/3.3.3/gremlin-shaded-3.3.3.pom
    -->
    <dependencies>
        <dependency>
            <groupId>com.esotericsoftware</groupId>
            <artifactId>kryo-shaded</artifactId>
            <version>3.0.1</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.esotericsoftware</groupId>
            <artifactId>minlog</artifactId>
            <version>1.3.0</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.objenesis</groupId>
            <artifactId>objenesis</artifactId>
            <version>2.1</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <optional>true</optional>
        </dependency>
    </dependencies>
    <build>
        <directory>${basedir}/target</directory>
        <finalName>${project.artifactId}-${project.version}</finalName>
        <plugins>
            <plugin>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <id>shade-kryo</id>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <artifactSet>
                                <includes>
                                    <include>com.esotericsoftware:*</include>
                                    <include>org.objenesis:*</include>
                                    <include>com.fasterxml.jackson.core:*</include>
                                </includes>
                            </artifactSet>
                            <relocations>
                                <relocation>
                                    <pattern>com.esotericsoftware.reflectasm</pattern>
                                    <shadedPattern>org.apache.tinkerpop.shaded.kryo</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>com.esotericsoftware.kryo</pattern>
                                    <shadedPattern>org.apache.tinkerpop.shaded.kryo</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>org.objenesis</pattern>
                                    <shadedPattern>org.apache.tinkerpop.shaded.objenesis</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>com.esotericsoftware.minlog</pattern>
                                    <shadedPattern>org.apache.tinkerpop.shaded.minlog</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>com.fasterxml.jackson</pattern>
                                    <shadedPattern>org.apache.tinkerpop.shaded.jackson</shadedPattern>
                                </relocation>
                            </relocations>
                            <!--
                             Exclude service descriptors because they still reference unshaded classes, this
                             causes an error if the JAR is used as an automatic module in a JPMS app.
                            -->
                            <filters>
                                <filter>
                                    <artifact>*</artifact>
                                    <excludes>
                                        <exclude>META-INF/services/**</exclude>
                                        <exclude>META-INF/MANIFEST.MF</exclude>
                                        <exclude>META-INF/LICENSE</exclude>
                                        <exclude>META-INF/NOTICE</exclude>
                                        <exclude>META-INF/versions/9/module-info.class</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                            <!-- false below means the shade plugin overwrites the main project artifact (the one with no classifier).
                                 false does *not* actually detach the main artifact, despite what the option name suggests. -->
                            <shadedArtifactAttached>false</shadedArtifactAttached>
                            <minimizeJar>false</minimizeJar>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- since the project is empty (i.e. no source code), we must "force" the 'javadoc' and 'sources' JARs
                creation in order to be compliant with Sonatype requirements for artifacts. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <id>javadoc-jar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <classifier>javadoc</classifier>
                        </configuration>
                    </execution>
                    <execution>
                        <id>sources-jar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <classifier>sources</classifier>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
