<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.holon-platform.mongo</groupId>
		<artifactId>holon-datastore-mongo-root</artifactId>
		<version>5.5.0</version>
	</parent>

	<artifactId>holon-datastore-mongo-sync</artifactId>
	<packaging>jar</packaging>

	<name>${project.groupId}:${project.artifactId}</name>
	<description>Holon MongoDB Datastore synchronous implementation</description>

	<url>https://holon-platform.com</url>

	<build>
		<plugins>
			<!-- Unit test -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<includes>
						<include>**/*UT.java</include>
					</includes>
					<excludes>
						<exclude>**/*IT.java</exclude>
					</excludes>
				</configuration>
			</plugin>
			<!-- JDK9 Automatic-Module-Name -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<manifestEntries>
							<Automatic-Module-Name>com.holonplatform.datastore.mongo.sync</Automatic-Module-Name>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<dependencies>

		<!-- MongoDB Datastore core -->
		<dependency>
			<groupId>com.holon-platform.mongo</groupId>
			<artifactId>holon-datastore-mongo-core</artifactId>
			<version>${project.version}</version>
		</dependency>

		<!-- MongoDB synchronous Java driver -->
		<dependency>
			<groupId>org.mongodb</groupId>
			<artifactId>mongodb-driver-sync</artifactId>
			<version>${mongo.driver.sync.version}</version>
			<scope>provided</scope>
		</dependency>

		<!-- Test -->
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.vintage</groupId>
			<artifactId>junit-vintage-engine</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>de.flapdoodle.embed</groupId>
			<artifactId>de.flapdoodle.embed.mongo</artifactId>
			<version>${embed.mongo.version}</version>
			<scope>test</scope>
		</dependency>

	</dependencies>

	<profiles>

		<!-- MongoDB 4 integration test -->
		<profile>
			<id>it-mongo4</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<skip>true</skip>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-failsafe-plugin</artifactId>
						<configuration>
							<includes>
								<include>**/*TransactionalOperationsIT.java</include>
							</includes>
						</configuration>
					</plugin>
					<plugin>
						<groupId>io.fabric8</groupId>
						<artifactId>docker-maven-plugin</artifactId>
						<configuration>
							<images>
								<image>
									<name>mongo:4.1</name>
									<alias>mongo</alias>
									<run>
										<ports>
											<port>27017:27017</port>
										</ports>
										<!-- <env> <MONGO_INITDB_ROOT_USERNAME>test</MONGO_INITDB_ROOT_USERNAME> 
											<MONGO_INITDB_ROOT_PASSWORD>test</MONGO_INITDB_ROOT_PASSWORD> </env> -->
										<wait>
											<time>10000</time>
										</wait>
									</run>
								</image>
							</images>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>

	</profiles>

</project>