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

    Copyright 2020-2022 the original author or authors.

    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

         https://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 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-migrations-parent</artifactId>
		<version>1.9.2</version>
	</parent>

	<artifactId>neo4j-migrations</artifactId>
	<name>Neo4j Migrations (Core)</name>
	<description>The Core API of Neo4j-Migrations.</description>

	<properties>
		<java-module-name>ac.simons.neo4j.migrations.core</java-module-name>
		<sonar.coverage.jacoco.xmlReportPaths>${basedir}/../${aggregate.report.dir}</sonar.coverage.jacoco.xmlReportPaths>
	</properties>

	<dependencies>

		<dependency>
			<groupId>io.github.classgraph</groupId>
			<artifactId>classgraph</artifactId>
		</dependency>

		<dependency>
			<groupId>org.neo4j.driver</groupId>
			<artifactId>neo4j-java-driver</artifactId>
		</dependency>

		<dependency>
			<groupId>com.tngtech.archunit</groupId>
			<artifactId>archunit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>eu.michael-simons.neo4j</groupId>
			<artifactId>junit-jupiter-causal-cluster-testcontainer-extension</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>eu.michael-simons.neo4j</groupId>
			<artifactId>neo4j-migrations-test-resources</artifactId>
			<version>${project.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.assertj</groupId>
			<artifactId>assertj-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-inline</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.powermock</groupId>
			<artifactId>powermock-reflect</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>jul-to-slf4j</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-simple</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.testcontainers</groupId>
			<artifactId>junit-jupiter</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.testcontainers</groupId>
			<artifactId>neo4j</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>com.github.siom79.japicmp</groupId>
				<artifactId>japicmp-maven-plugin</artifactId>
				<version>${japicmp-maven-plugin.version}</version>
				<configuration>
					<oldVersion>
						<dependency>
							<groupId>eu.michael-simons.neo4j</groupId>
							<artifactId>neo4j-migrations</artifactId>
							<version>${neo4j-migrations.previous.version}</version>
							<type>jar</type>
						</dependency>
					</oldVersion>
					<newVersion>
						<file>
							<path>${project.build.directory}/${project.artifactId}-${project.version}.${project.packaging}</path>
						</file>
					</newVersion>
					<parameter>
						<breakBuildBasedOnSemanticVersioning>true</breakBuildBasedOnSemanticVersioning>
						<overrideCompatibilityChangeParameters>
							<overrideCompatibilityChangeParameter>
								<!-- See https://github.com/siom79/japicmp/issues/201 -->
								<compatibilityChange>METHOD_NEW_DEFAULT</compatibilityChange>
								<binaryCompatible>true</binaryCompatible>
								<sourceCompatible>true</sourceCompatible>
								<semanticVersionLevel>MINOR</semanticVersionLevel>
							</overrideCompatibilityChangeParameter>
						</overrideCompatibilityChangeParameters>
						<excludes>
							<!--
							 | Those are public classes in a package private interface which cannot be accessed from outside my own package.
							 -->
							<exclude>ac.simons.neo4j.migrations.core.Discoverer$CypherBasedMigrationDiscoverer</exclude>
							<exclude>ac.simons.neo4j.migrations.core.Discoverer$JavaBasedMigrationDiscoverer</exclude>
							<exclude>ac.simons.neo4j.migrations.core.Precondition$Type</exclude>
							<!--
							 | Internal classes, restricted via JMS on JDK11+ anyway.
							 -->
							<exclude>ac.simons.neo4j.migrations.core.internal</exclude>

							<!-- 1.8.0: One time exclusion to refine an API that is most likely only used by us in the given release -->
							<exclude>ac.simons.neo4j.migrations.core.ResourceBasedMigrationProvider#supportsArbitraryResourceNames()</exclude>
							<exclude>ac.simons.neo4j.migrations.core.CypherResourceBasedMigrationProvider#handle(ac.simons.neo4j.migrations.core.ResourceContext)</exclude>
							<exclude>ac.simons.neo4j.migrations.core.DefaultCatalogBasedMigrationProvider#handle(ac.simons.neo4j.migrations.core.ResourceContext)</exclude>
							<exclude>ac.simons.neo4j.migrations.core.ResourceBasedMigrationProvider#handle(ac.simons.neo4j.migrations.core.ResourceContext)</exclude>
							<!-- 1.8.0: Was not public before -->
							<exclude>ac.simons.neo4j.migrations.core.CypherResource</exclude>
						</excludes>
					</parameter>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>cmp</goal>
						</goals>
						<phase>verify</phase>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
