<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>

	<groupId>de.hs-heilbronn.mi</groupId>
	<artifactId>db-test-utils</artifactId>
	<version>1.0.0</version>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>11</maven.compiler.source>
		<maven.compiler.target>11</maven.compiler.target>
		<maven.compiler.release>11</maven.compiler.release>

		<slf4j.version>2.0.9</slf4j.version>
	</properties>

	<name>db-test-utils</name>
	<description>Utility library for writing database integration tests with PostgreSQL and Liquibase for JUnit 4</description>
	<url>https://github.com/hhund/db-test-utils</url>

	<licenses>
		<license>
			<name>Apache License, Version 2.0</name>
			<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<organization>
		<name>Heilbronn University of Applied Sciences, Faculty of Informatics</name>
		<url>https://www.hs-heilbronn.de/it</url>
	</organization>

	<developers>
		<developer>
			<id>hhund</id>
			<name>Hauke Hund</name>
			<roles>
				<role>developer</role>
			</roles>
			<email>hauke.hund@hs-heilbronn.de</email>
			<organization>Heilbronn University of Applied Sciences, Faculty of Informatics</organization>
			<organizationUrl>https://www.hs-heilbronn.de/hauke.hund</organizationUrl>
		</developer>
	</developers>

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<name>Sonatype Nexus snapshot repository</name>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>ossrh</id>
			<name>Sonatype Nexus release repository</name>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>

	<scm>
		<connection>scm:git:git://github.com/hhund/db-test-utils.git</connection>
		<developerConnection>scm:git:git@github.com:hhund/db-test-utils.git</developerConnection>
		<url>https://github.com/hhund/db-test-utils</url>
	</scm>

	<dependencies>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-dbcp2</artifactId>
			<version>2.11.0</version>
			<exclusions>
				<exclusion>
					<groupId>commons-logging</groupId>
					<artifactId>commons-logging</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.liquibase</groupId>
			<artifactId>liquibase-core</artifactId>
			<version>4.24.0</version>
		</dependency>
		<dependency>
			<groupId>org.postgresql</groupId>
			<artifactId>postgresql</artifactId>
			<version>42.6.0</version>
		</dependency>
		<dependency>
			<groupId>org.testcontainers</groupId>
			<artifactId>postgresql</artifactId>
			<version>1.19.1</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>jcl-over-slf4j</artifactId>
			<version>${slf4j.version}</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>jul-to-slf4j</artifactId>
			<version>${slf4j.version}</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${slf4j.version}</version>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.13.2</version>
		</dependency>

		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-slf4j2-impl</artifactId>
			<version>2.21.1</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.11.0</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>3.3.0</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>3.6.2</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-gpg-plugin</artifactId>
				<version>3.1.0</version>
				<executions>
					<execution>
						<id>sign-artifacts</id>
						<phase>verify</phase>
						<goals>
							<goal>sign</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>3.2.2</version>
				<configuration>
					<excludedGroups>de.hsheilbronn.mi.utils.test.IntegrationTest</excludedGroups>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<version>3.2.2</version>
				<configuration>
					<includes>
						<include>**/*</include>
					</includes>
					<groups>de.hsheilbronn.mi.utils.test.IntegrationTest</groups>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>integration-test</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<version>3.4.1</version>
				<executions>
					<execution>
						<id>enforce-maven</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<requireMavenVersion>
									<version>3.3.9</version>
								</requireMavenVersion>
								<bannedDependencies>
									<excludes>
										<exclude>commons-logging:commons-logging</exclude>
									</excludes>
								</bannedDependencies>
							</rules>
							<fail>true</fail>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>io.fabric8</groupId>
				<artifactId>docker-maven-plugin</artifactId>
				<version>0.43.4</version>
				<extensions>true</extensions>

				<executions>
					<execution>
						<id>start-postgres</id>
						<phase>pre-integration-test</phase>
						<goals>
							<goal>start</goal>
						</goals>
						<configuration>
							<images>
								<image>
									<name>postgres:15</name>
									<run>
										<ports>
											<port>127.0.0.1:54321:5432</port>
										</ports>
										<env>
											<TZ>Europe/Berlin</TZ>
											<POSTGRES_USER>postgres</POSTGRES_USER>
											<POSTGRES_PASSWORD>password</POSTGRES_PASSWORD>
											<POSTGRES_DB>db</POSTGRES_DB>
										</env>
										<wait>
											<!-- <log>(?s)database system is ready to accept connections.*database system is ready to accept connections</log> -->
											<time>2500</time>
										</wait>
									</run>
								</image>
							</images>
						</configuration>
					</execution>
					<execution>
						<id>stop-postgres</id>
						<phase>post-integration-test</phase>
						<goals>
							<goal>stop</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>