<?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>com.floragunn.search-guard-encryption-at-rest</groupId>
    <artifactId>search-guard-encryption-at-rest-parent</artifactId>
    <version>${revision}</version>
  </parent>

  <artifactId>search-guard-encryption-at-rest-plugin</artifactId>
  <version>${revision}</version>
  <packaging>jar</packaging>

  <name>Search Guard Encryption at Rest Plugin</name>
  <description>Search Guard Encryption at Rest Plugin: Encryption at Rest for Elasticsearch</description>

  <properties>
    <elasticsearch.assembly.descriptor>${basedir}/src/main/assemblies/plugin.xml</elasticsearch.assembly.descriptor>
    <config-file.eclipse-formatter>${project.basedir}${file.separator}..${file.separator}eclipse-code-format-profile.xml</config-file.eclipse-formatter>
  </properties>

  <dependencies>
    <!-- Main dependencies -->
    <dependency>
      <groupId>com.floragunn.search-guard-encryption-at-rest</groupId>
      <artifactId>search-guard-encryption-at-rest-lucene</artifactId>
      <version>${revision}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.elasticsearch</groupId>
      <artifactId>elasticsearch</artifactId>
      <version>${elasticsearch.version}</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <groupId>org.elasticsearch</groupId>
          <artifactId>elasticsearch-preallocate</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.floragunn</groupId>
      <artifactId>codova</artifactId>
    </dependency>
    <dependency>
      <groupId>com.floragunn</groupId>
      <artifactId>fluent-collections</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>failureaccess</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcprov-jdk18on</artifactId>
    </dependency>

    <!-- Test dependencies -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.dataformat</groupId>
      <artifactId>jackson-dataformat-yaml</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.lucene</groupId>
      <artifactId>lucene-test-framework</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.elasticsearch.client</groupId>
      <artifactId>elasticsearch-rest-client</artifactId>
      <version>${elasticsearch.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.elasticsearch.plugin</groupId>
      <artifactId>transport-netty4</artifactId>
      <version>${elasticsearch.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.elasticsearch.plugin</groupId>
      <artifactId>reindex</artifactId>
      <version>${elasticsearch.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.elasticsearch.plugin</groupId>
      <artifactId>rest-root</artifactId>
      <version>${elasticsearch.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpcore</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-embedder</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-compat</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.resolver</groupId>
      <artifactId>maven-resolver-connector-basic</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.resolver</groupId>
      <artifactId>maven-resolver-transport-http</artifactId>
      <scope>test</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.testcontainers/testcontainers -->
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>testcontainers</artifactId>
      <version>1.21.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>2.0.17</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>2.0.17</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-resources</id>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <outputDirectory>${basedir}</outputDirectory>
              <resources>
                <resource>
                  <directory>src/main/descriptor</directory>
                  <filtering>true</filtering>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>plugin</id>
            <goals>
              <goal>single</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <appendAssemblyId>false</appendAssemblyId>
              <tarLongFileMode>posix</tarLongFileMode>
              <finalName>${project.artifactId}-${revision}</finalName>
              <outputDirectory>${project.build.directory}/releases/</outputDirectory>
              <descriptors>
                <descriptor>${elasticsearch.assembly.descriptor}</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <configuration>
          <filesets>
            <fileset>
              <directory>${project.basedir}</directory>
              <includes>
                <include>plugin-descriptor.properties</include>
                <include>entitlement-policy.yaml</include>
              </includes>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.floragunn</groupId>
        <artifactId>checksum-maven-plugin</artifactId>
        <version>1.7.1</version>
        <configuration>
          <fileSets>
            <fileSet>
              <directory>${project.build.directory}/releases/</directory>
              <includes>
                <include>*.zip</include>
              </includes>
            </fileSet>
          </fileSets>
          <algorithms>
            <algorithm>SHA-512</algorithm>
          </algorithms>
          <individualFiles>true</individualFiles>
          <appendFilename>true</appendFilename>
          <attachChecksums>true</attachChecksums>
          <csvSummary>false</csvSummary>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>files</goal>
            </goals>
            <phase>package</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
