<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2016-2023 Crown Copyright
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<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>uk.gov.gchq.gaffer</groupId>
        <artifactId>store-implementation</artifactId>
        <version>2.2.1</version>
    </parent>

    <artifactId>accumulo-store</artifactId>

    <dependencies>
        <!-- Gaffer dependencies -->
        <dependency>
            <groupId>uk.gov.gchq.gaffer</groupId>
            <artifactId>graph</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
        <dependency>
            <groupId>uk.gov.gchq.gaffer</groupId>
            <artifactId>hdfs-library</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
        <dependency>
            <groupId>uk.gov.gchq.gaffer</groupId>
            <artifactId>sketches-library</artifactId>
            <version>${project.parent.version}</version>
        </dependency>

        <!-- External libraries -->
        <dependency>
            <groupId>org.apache.accumulo</groupId>
            <artifactId>accumulo-core</artifactId>
            <version>${accumulo.version}</version>
            <!-- hadoop-hdfs and avro use an older version of Jersey so to avoid deployment issues it must be excluded -->
            <exclusions>
                <exclusion>
                    <groupId>org.apache.hadoop</groupId>
                    <artifactId>hadoop-hdfs</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.avro</groupId>
                    <artifactId>avro-ipc</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jersey</groupId>
                    <artifactId>jersey-client</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jersey.jersey-test-framework</groupId>
                    <artifactId>jersey-test-framework-grizzly2</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jersey</groupId>
                    <artifactId>jersey-server</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jersey</groupId>
                    <artifactId>jersey-json</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jersey.contribs</groupId>
                    <artifactId>jersey-guice</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.netty</groupId>
                    <artifactId>netty</artifactId>
                </exclusion>
                <!-- Conflicts with Reload4j -->
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Testing dependencies -->
        <dependency>
            <groupId>org.apache.accumulo</groupId>
            <artifactId>accumulo-minicluster</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>uk.gov.gchq.gaffer</groupId>
            <artifactId>store</artifactId>
            <version>${project.parent.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>uk.gov.gchq.gaffer</groupId>
            <artifactId>data</artifactId>
            <version>${project.parent.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>uk.gov.gchq.gaffer</groupId>
            <artifactId>graph</artifactId>
            <version>${project.parent.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>uk.gov.gchq.gaffer</groupId>
            <artifactId>operation</artifactId>
            <version>${project.parent.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>uk.gov.gchq.gaffer</groupId>
            <artifactId>common-util</artifactId>
            <version>${project.parent.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>uk.gov.gchq.gaffer</groupId>
            <artifactId>integration-test</artifactId>
            <version>${project.parent.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>uk.gov.gchq.gaffer</groupId>
            <artifactId>integration-test</artifactId>
            <version>${project.parent.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>uk.gov.gchq.gaffer</groupId>
            <artifactId>serialisation</artifactId>
            <version>${project.parent.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>uk.gov.gchq.gaffer</groupId>
            <artifactId>hdfs-library</artifactId>
            <version>${project.parent.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>uk.gov.gchq.gaffer</groupId>
            <artifactId>map-store</artifactId>
            <version>${project.parent.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-hdfs</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-suite</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-shade-plugin</artifactId>
                <version>${shade.plugin.version}</version>
                <executions>
                    <execution>
                        <id>iterators</id>
                        <phase>${shaded.jar.phase}</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>true
                            </shadedArtifactAttached>
                            <shadedClassifierName>iterators${append.shaded.classifier}
                            </shadedClassifierName>
                            <artifactSet>
                                <includes>
                                    <include>uk.gov.gchq.koryphe*</include>
                                    <include>uk.gov.gchq.gaffer*</include>
                                    <include>com.google.guava:*</include>
                                    <include>org.apache.commons:commons-lang3
                                    </include>
                                    <include>com.fasterxml.jackson.*:*</include>
                                    <include>com.clearspring.analytics:stream
                                    </include>
                                    <include>com.yahoo.*</include>
                                    <include>io.github.lukehutch*</include>
                                </includes>
                            </artifactSet>
                            <relocations>
                                <relocation>
                                    <pattern>com.fasterxml.jackson</pattern>
                                    <shadedPattern>hidden.com.fasterxml.jackson</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>org.apache.commons.lang3</pattern>
                                    <shadedPattern>hidden.org.apache.commons.lang3</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>com.google</pattern>
                                    <shadedPattern>hidden.com.google</shadedPattern>
                                </relocation>
                            </relocations>
                        </configuration>
                    </execution>
                    <execution>
                        <id>utility</id>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>true
                            </shadedArtifactAttached>
                            <shadedClassifierName>utility${append.shaded.classifier}
                            </shadedClassifierName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
