<?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>
	<parent>
		<groupId>eu.michael-simons.neo4j</groupId>
		<artifactId>neo4j-ogm-quarkus-parent</artifactId>
		<version>1.0.0</version>
	</parent>
	<artifactId>neo4j-ogm-quarkus-integration-tests</artifactId>
	<name>Neo4j-OGM (Quarkus Integration Tests)</name>
	<description>Integration tests for the Quarkus integration of Neo4j-OGM.</description>
	<properties>
		<java-module-name>ac.simons.neo4j.ogm.quarkus.tests</java-module-name>
		<neo4j.password>secret</neo4j.password>
		<neo4j.username>neo4j</neo4j.username>
	</properties>
	<dependencies>
		<dependency>
			<groupId>eu.michael-simons.neo4j</groupId>
			<artifactId>neo4j-migrations-quarkus</artifactId>
		</dependency>
		<dependency>
			<groupId>eu.michael-simons.neo4j</groupId>
			<artifactId>neo4j-ogm-quarkus</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>io.quarkus</groupId>
			<artifactId>quarkus-resteasy</artifactId>
		</dependency>
		<dependency>
			<groupId>io.quarkus</groupId>
			<artifactId>quarkus-resteasy-jsonb</artifactId>
		</dependency>
		<dependency>
			<groupId>io.quarkus</groupId>
			<artifactId>quarkus-junit5</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.rest-assured</groupId>
			<artifactId>rest-assured</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<build>
		<plugins>
			<plugin>
				<groupId>io.quarkus</groupId>
				<artifactId>quarkus-maven-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>build</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>io.fabric8</groupId>
				<artifactId>docker-maven-plugin</artifactId>
				<version>${docker-maven-plugin.version}</version>
				<configuration>
					<images>
						<image>
							<name>${neo4j.image}</name>
							<run>
								<ports>
									<port>it-database-port:7687</port>
								</ports>
								<env>
									<NEO4J_AUTH>neo4j/${neo4j.password}</NEO4J_AUTH>
									<NEO4J_dbms_memory_pagecache_size>10M</NEO4J_dbms_memory_pagecache_size>
									<NEO4J_dbms_memory_heap_initial__size>10M</NEO4J_dbms_memory_heap_initial__size>
								</env>
								<log>
									<prefix>Neo4j:</prefix>
									<date>default</date>
									<color>cyan</color>
								</log>
								<wait>
									<log>.*Started\.</log>
									<time>40000</time>
								</wait>
							</run>
						</image>
					</images>
				</configuration>
				<executions>
					<execution>
						<id>prepare-it-database</id>
						<goals>
							<goal>start</goal>
						</goals>
						<phase>pre-integration-test</phase>
					</execution>
					<execution>
						<id>remove-it-database</id>
						<goals>
							<goal>stop</goal>
						</goals>
						<phase>post-integration-test</phase>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-failsafe-plugin</artifactId>
				<configuration combine.self="append">
					<environmentVariables>
						<QUARKUS_NEO4J_AUTHENTICATION_USERNAME>${neo4j.username}</QUARKUS_NEO4J_AUTHENTICATION_USERNAME>
						<QUARKUS_NEO4J_AUTHENTICATION_PASSWORD>${neo4j.password}</QUARKUS_NEO4J_AUTHENTICATION_PASSWORD>
						<QUARKUS_NEO4J_URI>bolt://localhost:${it-database-port}</QUARKUS_NEO4J_URI>
					</environmentVariables>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-install-plugin</artifactId>
				<configuration>
					<skip>true</skip>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
				<configuration>
					<skip>true</skip>
				</configuration>
			</plugin>
		</plugins>
	</build>
	<profiles>
		<profile>
			<id>native-image</id>
			<activation>
				<property>
					<name>native</name>
				</property>
			</activation>
			<properties>
				<quarkus.package.type>native</quarkus.package.type>
			</properties>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-failsafe-plugin</artifactId>
						<executions>
							<execution>
								<configuration combine.self="append">
									<systemPropertyVariables>
										<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
									</systemPropertyVariables>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
