<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.floragunn.search-guard-encryption-at-rest</groupId>
  <artifactId>search-guard-encryption-at-rest-parent</artifactId>
  <version>${revision}</version>
  <packaging>pom</packaging>
  <name>Search Guard Encryption at Rest</name>

  <modules>
    <module>encryption-ctl</module>
    <module>encryption-plugin</module>
    <module>encryption-lucene</module>
  </modules>

  <distributionManagement>
    <repository>
      <id>release</id>
      <name>Release repository</name>
      <url>https://maven.search-guard.com/search-guard-encryption-at-rest-release</url>
    </repository>
    <snapshotRepository>
      <id>snapshot</id>
      <name>Snapshot repository</name>
      <url>https://maven.search-guard.com/search-guard-encryption-at-rest-snapshot</url>
    </snapshotRepository>
  </distributionManagement>

  <properties>
    <encryption-at-rest.version>1.0.0</encryption-at-rest.version>
    <elasticsearch.version>9.5.2</elasticsearch.version>
    <!-- lucene.version and log4j2.version depend on elasticsearch version-->
    <lucene.version>10.5.1</lucene.version>
    <log4j2.version>2.26.1</log4j2.version>
    <revision>${encryption-at-rest.version}-es-${elasticsearch.version}-SNAPSHOT</revision>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <!-- 17 for the CTL CLI Tool -->
    <maven.compiler.release>23</maven.compiler.release>
    <http.client.version>4.5.14</http.client.version>
    <http.core.version>4.4.16</http.core.version>
    <bc.version>1.85</bc.version>
    <junit.version>4.13.2</junit.version>
    <hamcrest.version>3.0</hamcrest.version>
    <jackson.version>2.22.1</jackson.version>
    <commons-io.version>2.22.0</commons-io.version>
    <codova.version>1.10.1</codova.version>
    <fluent-collections.version>1.3.0</fluent-collections.version>
    <guava.version>33.6.0-jre</guava.version>
    <mockito.version>5.23.0</mockito.version>
    <google.failureaccess>1.0.3</google.failureaccess>
    <maven-resolver.version>1.9.27</maven-resolver.version>
    <config-file.eclipse-formatter>${project.basedir}${file.separator}eclipse-code-format-profile.xml</config-file.eclipse-formatter>
    <license.excludedArtifacts>.*search-guard.*</license.excludedArtifacts>
    <license.excludedScopes>test,provided</license.excludedScopes>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>${guava.version}</version>
      </dependency>
      <dependency>
        <groupId>com.floragunn</groupId>
        <artifactId>codova</artifactId>
        <version>${codova.version}</version>
      </dependency>
      <dependency>
        <groupId>com.floragunn</groupId>
        <artifactId>fluent-collections</artifactId>
        <version>${fluent-collections.version}</version>
      </dependency>
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-core</artifactId>
        <version>${hamcrest.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore</artifactId>
        <version>${http.core.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>${http.client.version}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>${jackson.version}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.dataformat</groupId>
        <artifactId>jackson-dataformat-yaml</artifactId>
        <version>${jackson.version}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${jackson.version}</version>
      </dependency>
      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>${commons-io.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-core</artifactId>
        <version>${lucene.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-test-framework</artifactId>
        <version>${lucene.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>${log4j2.version}</version>
      </dependency>
      <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcprov-jdk18on</artifactId>
        <version>${bc.version}</version>
      </dependency>
      <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcpkix-jdk18on</artifactId>
        <version>${bc.version}</version>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${mockito.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>failureaccess</artifactId>
        <version>${google.failureaccess}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-embedder</artifactId>
        <version>3.9.16</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-compat</artifactId>
        <version>3.9.16</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.resolver</groupId>
        <artifactId>maven-resolver-connector-basic</artifactId>
        <version>${maven-resolver.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.resolver</groupId>
        <artifactId>maven-resolver-transport-http</artifactId>
        <version>${maven-resolver.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <repositories>
    <repository>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>sg-util-release</id>
      <url>https://maven.search-guard.com:443/util</url>
    </repository>
    <repository>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>elasticsearch-releases</id>
      <url>https://artifacts.elastic.co/maven</url>
    </repository>
    <repository>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <id>third-party</id>
      <url>https://maven.search-guard.com:443/third-party</url>
    </repository>
  </repositories>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.15.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>3.8.0</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>3.6.1</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>2.7.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>3.6.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.5.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.5.0</version>
        </plugin>
        <plugin>
          <groupId>org.skife.maven</groupId>
          <artifactId>really-executable-jar-maven-plugin</artifactId>
          <version>2.1.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.5.6</version>
          <configuration>
            <argLine>-Xmx3072m</argLine>
            <includes>
              <include>**/*.java</include>
            </includes>
            <trimStackTrace>false</trimStackTrace>
          </configuration>
        </plugin>
        <plugin>
          <groupId>com.diffplug.spotless</groupId>
          <artifactId>spotless-maven-plugin</artifactId>
          <version>3.8.0</version>
          <configuration>
            <pom>
              <includes>
                <include>/**/pom.xml</include>
              </includes>
              <sortPom/>
            </pom>
            <java>
              <toggleOffOn/>
              <removeUnusedImports/>
              <formatAnnotations/>
              <eclipse>
                <version>4.36</version>
                <!-- the configuration is loaded in root module and submodule where the configuration is inherited -->
                <!-- maven 4.0.0 does not support ${project.rootDirectory}  https://issues.apache.org/jira/browse/MNG-7038-->
                <file>${config-file.eclipse-formatter}</file>
              </eclipse>
              <licenseHeader>
                <content><![CDATA[
/*
 * Copyright (c) 2025 floragunn GmbH
 *
 * This source code is licensed under a proprietary license.
 * You may view, read, and study this code, but you may not use, reproduce,
 * distribute, modify, or create derivative works unless you have
 * received explicit written permission from floragunn GmbH.
 *
 * For more information, see the LICENSE.txt file in this repository or contact: info@floragunn.com
 */
				]]></content>
              </licenseHeader>
            </java>
          </configuration>
          <executions>
            <execution>
              <id>spotless-check</id>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
      </plugin>
      <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>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.6.3</version>
        <executions>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>[3.8.1,)</version>
                  <message>Maven 3.8.1 or later required</message>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
          <execution>
            <id>enforce-java</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <version>[23,)</version>
                  <message>Java 23 or later required to build the plugin</message>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>

</project>
