<?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>

	<artifactId>spring-data-mongodb</artifactId>

	<name>Spring Data MongoDB - Core</name>
	<description>MongoDB support for Spring Data</description>

	<parent>
		<groupId>org.springframework.data</groupId>
		<artifactId>spring-data-mongodb-parent</artifactId>
		<version>5.1.0-M2</version>
		<relativePath>../pom.xml</relativePath>
	</parent>

	<properties>
		<objenesis>1.3</objenesis>
		<equalsverifier>1.7.8</equalsverifier>
		<java-module-name>spring.data.mongodb</java-module-name>
		<project.root>${basedir}/..</project.root>
		<multithreadedtc>1.01</multithreadedtc>
	</properties>

	<dependencies>

		<!-- MongoDB Driver -->
		<dependency>
			<groupId>org.mongodb</groupId>
			<artifactId>mongodb-driver-core</artifactId>
		</dependency>

		<dependency>
			<groupId>org.mongodb</groupId>
			<artifactId>mongodb-driver-sync</artifactId>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>org.mongodb</groupId>
			<artifactId>mongodb-driver-reactivestreams</artifactId>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>org.mongodb</groupId>
			<artifactId>mongodb-crypt</artifactId>
			<optional>true</optional>
		</dependency>

		<!-- Spring -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-tx</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-beans</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-expression</artifactId>
		</dependency>

		<!-- Spring Data -->
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>spring-data-commons</artifactId>
			<version>${springdata.commons}</version>
		</dependency>

		<dependency>
			<groupId>com.querydsl</groupId>
			<artifactId>querydsl-mongodb</artifactId>
			<version>${querydsl}</version>
			<optional>true</optional>
			<exclusions>
				<exclusion>
					<groupId>org.mongodb</groupId>
					<artifactId>mongo-java-driver</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>com.querydsl</groupId>
			<artifactId>querydsl-apt</artifactId>
			<version>${querydsl}</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>javax.annotation</groupId>
			<artifactId>jsr250-api</artifactId>
			<version>1.0</version>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>com.google.code.findbugs</groupId>
			<artifactId>jsr305</artifactId>
			<version>3.0.2</version>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>io.projectreactor</groupId>
			<artifactId>reactor-core</artifactId>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>io.projectreactor</groupId>
			<artifactId>reactor-test</artifactId>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>org.awaitility</groupId>
			<artifactId>awaitility</artifactId>
			<version>${awaitility}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>io.reactivex.rxjava3</groupId>
			<artifactId>rxjava</artifactId>
			<version>${rxjava3}</version>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>net.javacrumbs.json-unit</groupId>
			<artifactId>json-unit-assertj</artifactId>
			<version>4.1.0</version>
			<scope>test</scope>
		</dependency>

		<!-- CDI -->
		<!-- Dependency order required to build against CDI 1.0 and test with CDI 2.0 -->
		<dependency>
			<groupId>javax.interceptor</groupId>
			<artifactId>javax.interceptor-api</artifactId>
			<version>1.2.1</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>jakarta.enterprise</groupId>
			<artifactId>jakarta.enterprise.cdi-api</artifactId>
			<version>${cdi}</version>
			<scope>provided</scope>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>jakarta.annotation</groupId>
			<artifactId>jakarta.annotation-api</artifactId>
			<version>${jakarta-annotation-api}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.apache.openwebbeans</groupId>
			<artifactId>openwebbeans-se</artifactId>
			<version>${webbeans}</version>
			<scope>test</scope>
		</dependency>

		<!-- JSR 303 Validation -->
		<dependency>
			<groupId>jakarta.validation</groupId>
			<artifactId>jakarta.validation-api</artifactId>
			<version>${validation}</version>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>org.objenesis</groupId>
			<artifactId>objenesis</artifactId>
			<version>${objenesis}</version>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>io.micrometer</groupId>
			<artifactId>micrometer-observation</artifactId>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>io.micrometer</groupId>
			<artifactId>micrometer-tracing</artifactId>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>org.hibernate.validator</groupId>
			<artifactId>hibernate-validator</artifactId>
			<version>7.0.1.Final</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>jakarta.el</groupId>
			<artifactId>jakarta.el-api</artifactId>
			<version>4.0.0</version>
			<scope>provided</scope>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>org.glassfish</groupId>
			<artifactId>jakarta.el</artifactId>
			<version>4.0.2</version>
			<scope>provided</scope>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>nl.jqno.equalsverifier</groupId>
			<artifactId>equalsverifier</artifactId>
			<version>${equalsverifier}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-webmvc</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>de.schauderhaft.degraph</groupId>
			<artifactId>degraph-check</artifactId>
			<version>0.1.4</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>edu.umd.cs.mtc</groupId>
			<artifactId>multithreadedtc</artifactId>
			<version>${multithreadedtc}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.junit-pioneer</groupId>
			<artifactId>junit-pioneer</artifactId>
			<version>2.3.0</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.junit.platform</groupId>
			<artifactId>junit-platform-launcher</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.testcontainers</groupId>
			<artifactId>testcontainers-junit-jupiter</artifactId>
			<version>${testcontainers}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.testcontainers</groupId>
			<artifactId>testcontainers-mongodb</artifactId>
			<version>${testcontainers}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>jakarta.transaction</groupId>
			<artifactId>jakarta.transaction-api</artifactId>
			<version>2.0.0</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core-test</artifactId>
			<scope>test</scope>
		</dependency>

		<!-- Kotlin extension -->
		<dependency>
			<groupId>org.jetbrains.kotlin</groupId>
			<artifactId>kotlin-stdlib</artifactId>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>org.jetbrains.kotlin</groupId>
			<artifactId>kotlin-reflect</artifactId>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>org.jetbrains.kotlinx</groupId>
			<artifactId>kotlinx-coroutines-core</artifactId>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>org.jetbrains.kotlinx</groupId>
			<artifactId>kotlinx-coroutines-reactor</artifactId>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>io.mockk</groupId>
			<artifactId>mockk-jvm</artifactId>
			<version>${mockk}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>io.micrometer</groupId>
			<artifactId>micrometer-test</artifactId>
			<scope>test</scope>
			<exclusions>
				<exclusion>
					<groupId>com.github.tomakehurst</groupId>
					<artifactId>wiremock-jre8-standalone</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>io.micrometer</groupId>
			<artifactId>micrometer-tracing-test</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>io.micrometer</groupId>
			<artifactId>micrometer-tracing-integration-test</artifactId>
			<scope>test</scope>
		</dependency>

		<!-- jMolecules -->
		<dependency>
			<groupId>org.jmolecules</groupId>
			<artifactId>jmolecules-ddd</artifactId>
			<scope>test</scope>
		</dependency>

	</dependencies>

	<profiles>
		<profile>
			<id>no-vector-search-tests</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<excludes combine.children="append">
								<exclude>**/VectorIndexIntegrationTests.java</exclude>
								<exclude>**/VectorSearchTests.java</exclude>
								<exclude>**/ReactiveVectorSearchTests.java</exclude>
								<exclude>**/MongoRepositoryContributorTests.java</exclude>
							</excludes>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>nullaway</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-compiler-plugin</artifactId>
						<configuration>
							<annotationProcessorPaths>
								<path>
									<groupId>com.querydsl</groupId>
									<artifactId>querydsl-apt</artifactId>
									<version>${querydsl}</version>
								</path>
								<path>
									<groupId>org.openjdk.jmh</groupId>
									<artifactId>jmh-generator-annprocess</artifactId>
									<version>${jmh}</version>
								</path>
								<path>
									<groupId>com.google.errorprone</groupId>
									<artifactId>error_prone_core</artifactId>
									<version>${errorprone}</version>
								</path>
								<path>
									<groupId>com.uber.nullaway</groupId>
									<artifactId>nullaway</artifactId>
									<version>${nullaway}</version>
								</path>
							</annotationProcessorPaths>
						</configuration>
						<executions>
							<execution>
								<id>default-compile</id>
								<phase>none</phase>
							</execution>
							<execution>
								<id>default-testCompile</id>
								<phase>none</phase>
							</execution>
							<execution>
								<id>java-compile</id>
								<phase>compile</phase>
								<goals>
									<goal>compile</goal>
								</goals>
								<configuration>
									<compilerArgs>
										<arg>-XDcompilePolicy=simple</arg>
										<arg>--should-stop=ifError=FLOW</arg>
										<arg>-Xplugin:ErrorProne -XepDisableAllChecks -Xep:NullAway:ERROR -XepOpt:NullAway:OnlyNullMarked=true -XepOpt:NullAway:TreatGeneratedAsUnannotated=true -XepOpt:NullAway:CustomContractAnnotations=org.springframework.lang.Contract</arg>
									</compilerArgs>
								</configuration>
							</execution>
							<execution>
								<id>java-test-compile</id>
								<phase>test-compile</phase>
								<goals>
									<goal>testCompile</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<build>
		<plugins>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<annotationProcessorPaths>
						<path>
							<groupId>org.openjdk.jmh</groupId>
							<artifactId>jmh-generator-annprocess</artifactId>
							<version>${jmh}</version>
						</path>
					</annotationProcessorPaths>
				</configuration>
			</plugin>

			<plugin>
				<groupId>com.mysema.maven</groupId>
				<artifactId>apt-maven-plugin</artifactId>
				<version>${apt}</version>
				<dependencies>
					<dependency>
						<groupId>com.querydsl</groupId>
						<artifactId>querydsl-apt</artifactId>
						<version>${querydsl}</version>
					</dependency>
				</dependencies>
				<executions>
					<execution>
						<phase>generate-test-sources</phase>
						<goals>
							<goal>test-process</goal>
						</goals>
						<configuration>
							<outputDirectory>target/generated-test-sources
							</outputDirectory>
							<processor>
								org.springframework.data.mongodb.repository.support.MongoAnnotationProcessor
							</processor>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<useSystemClassLoader>false</useSystemClassLoader>
					<useFile>false</useFile>
					<includes>
						<include>**/*Tests.java</include>
					</includes>
					<excludes>
						<exclude>**/PerformanceTests.java</exclude>
						<exclude>**/ReactivePerformanceTests.java</exclude>
					</excludes>
					<systemPropertyVariables>
						<mongo.client>${mongo}</mongo.client>
						<mongo.server>${env.MONGO_VERSION}</mongo.server>
						<java.util.logging.config.file>
							src/test/resources/logging.properties
						</java.util.logging.config.file>
						<reactor.trace.cancel>true</reactor.trace.cancel>
					</systemPropertyVariables>
				</configuration>
			</plugin>

		</plugins>

	</build>

</project>
