<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright © 2015 The Gravitee team (http://gravitee.io)

    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 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>io.gravitee.apim.repository</groupId>
    <artifactId>gravitee-apim-repository</artifactId>
    <version>4.8.30</version>
  </parent>
  <artifactId>gravitee-apim-repository-mongodb</artifactId>
  <version>4.8.30</version>
  <name>Gravitee.io APIM - Repository - MongoDB</name>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
      <comments>A business-friendly OSS license</comments>
    </license>
  </licenses>
  <properties>
    <publish-folder-path>graviteeio-apim/plugins/repositories</publish-folder-path>
  </properties>
  <dependencies>
    <dependency>
      <groupId>io.gravitee.apim.repository</groupId>
      <artifactId>gravitee-apim-repository-api</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.gravitee.platform</groupId>
      <artifactId>gravitee-platform-repository-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.projectreactor.addons</groupId>
      <artifactId>reactor-adapter</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.activation</groupId>
      <artifactId>jakarta.activation-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.annotation</groupId>
      <artifactId>jakarta.annotation-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.mongodb</groupId>
      <artifactId>mongodb-driver-sync</artifactId>
      <version>${mongo.version}</version>
    </dependency>
    <dependency>
      <groupId>org.mongodb</groupId>
      <artifactId>mongodb-driver-reactivestreams</artifactId>
      <version>${mongo.version}</version>
      <exclusions>
        <exclusion>
          <groupId>org.reactivestreams</groupId>
          <artifactId>reactive-streams</artifactId>
        </exclusion>
        <exclusion>
          <groupId>io.projectreactor</groupId>
          <artifactId>reactor-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.mongodb</groupId>
      <artifactId>mongodb-crypt</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>net.java.dev.jna</groupId>
      <artifactId>jna</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-expression</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-tx</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.data</groupId>
      <artifactId>spring-data-mongodb</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-beans</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-context</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-expression</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.springframework</groupId>
          <artifactId>spring-tx</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>io.projectreactor</groupId>
      <artifactId>reactor-core</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.gravitee.apim.repository</groupId>
      <artifactId>gravitee-apim-repository-test</artifactId>
      <version>${project.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>mongodb</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.yaml</groupId>
      <artifactId>snakeyaml</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <resources>
      <resource>
        <filtering>true</filtering>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <executions>
          <execution>
            <id>default-test</id>
            <phase>none</phase>
          </execution>
          <execution>
            <id>without-encryption</id>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <systemPropertyVariables>
                <management.mongodb.encryption.enabled>false</management.mongodb.encryption.enabled>
              </systemPropertyVariables>
            </configuration>
          </execution>
          <execution>
            <id>with-encryption</id>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <systemPropertyVariables>
                <management.mongodb.encryption.enabled>true</management.mongodb.encryption.enabled>
              </systemPropertyVariables>
              <includes>
                <include>io.gravitee.repository.management.UserRepositoryTest</include>
                <include>io.gravitee.repository.management.LicenseRepositoryTest</include>
                <include>io.gravitee.repository.management.MetadataRepositoryTest</include>
                <include>io.gravitee.repository.management.TokenRepositoryTest</include>
              </includes>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <excludes>
            <exclude>**/distributedsync/*.java</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
</project>
