<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>software.xdev</groupId>
	<artifactId>chartjs-java-model</artifactId>
	<version>1.3.1</version>
	<packaging>jar</packaging>

	<name>chartjs-java-model</name>
	<description>chartjs-java-model</description>
	<url>https://github.com/xdev-software/chartjs-java-model</url>

	<scm>
		<url>https://github.com/xdev-software/chartjs-java-model</url>
		<connection>scm:git:https://github.com/xdev-software/chartjs-java-model.git</connection>
	</scm>

	<inceptionYear>2023</inceptionYear>

	<organization>
		<name>XDEV Software</name>
		<url>https://xdev.software</url>
	</organization>

	<developers>
		<developer>
			<name>XDEV Software</name>
			<organization>XDEV Software</organization>
			<url>https://xdev.software</url>
		</developer>
	</developers>

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

	<properties>
		<javaVersion>11</javaVersion>
		<maven.compiler.release>${javaVersion}</maven.compiler.release>

		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

		<slf4j-version>2.0.13</slf4j-version>
		<log4j-version>2.23.1</log4j-version>
		<testcontainers-version>1.19.8</testcontainers-version>

		<!-- by default run no tests as Docker is required -->
		<skipTests>true</skipTests>
	</properties>

	<repositories>
		<!-- The order of definitions matters. Explicitly defining central here 
			to make sure it has the highest priority. -->
		<repository>
			<id>central</id>
			<url>https://repo.maven.apache.org/maven2</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
	</repositories>

	<pluginRepositories>
		<!-- The order of definitions matters. Explicitly defining central here 
			to make sure it has the highest priority. -->
		<pluginRepository>
			<id>central</id>
			<url>https://repo.maven.apache.org/maven2</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</pluginRepository>
	</pluginRepositories>

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>ossrh</id>
			<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>

	<dependencies>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<version>2.17.1</version>
		</dependency>

		<!-- Tests -->
		<!-- Logging -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${slf4j-version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>jul-to-slf4j</artifactId>
			<version>${slf4j-version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-core</artifactId>
			<version>${log4j-version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-slf4j2-impl</artifactId>
			<version>${log4j-version}</version>
			<scope>test</scope>
		</dependency>

		<!-- JUnit -->
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter</artifactId>
			<version>5.10.2</version>
			<scope>test</scope>
		</dependency>

		<!-- Testcontainers -->
		<dependency>
			<groupId>org.testcontainers</groupId>
			<artifactId>testcontainers</artifactId>
			<version>${testcontainers-version}</version>
			<scope>test</scope>
			<exclusions>
				<!-- No JUnit 4 -->
				<exclusion>
					<groupId>junit</groupId>
					<artifactId>junit</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>software.xdev</groupId>
			<artifactId>testcontainers-junit4-mock</artifactId>
			<version>1.0.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.testcontainers</groupId>
			<artifactId>junit-jupiter</artifactId>
			<version>${testcontainers-version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>software.xdev</groupId>
			<artifactId>testcontainers-selenium</artifactId>
			<version>1.0.1</version>
			<scope>test</scope>
		</dependency>

		<!-- Selenium -->
		<dependency>
			<groupId>org.seleniumhq.selenium</groupId>
			<artifactId>selenium-chrome-driver</artifactId>
			<version>4.20.0</version>
			<scope>test</scope>
			<exclusions>
				<!-- Tracing is not needed -->
				<exclusion>
					<groupId>io.opentelemetry</groupId>
					<artifactId>*</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
	</dependencies>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-site-plugin</artifactId>
					<version>4.0.0-M14</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-project-info-reports-plugin</artifactId>
					<version>3.5.0</version>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
			<plugin>
				<groupId>com.mycila</groupId>
				<artifactId>license-maven-plugin</artifactId>
				<version>4.5</version>
				<configuration>
					<properties>
						<email>${project.organization.url}</email>
					</properties>
					<licenseSets>
						<licenseSet>
							<header>com/mycila/maven/plugin/license/templates/APACHE-2.txt</header>
							<includes>
								<include>src/main/java/**</include>
								<include>src/test/java/**</include>
							</includes>
						</licenseSet>
					</licenseSets>
				</configuration>
				<executions>
					<execution>
						<id>first</id>
						<goals>
							<goal>format</goal>
						</goals>
						<phase>process-sources</phase>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.13.0</version>
				<configuration>
					<release>${maven.compiler.release}</release>
					<compilerArgs>
						<arg>-proc:none</arg>
					</compilerArgs>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>3.6.3</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<phase>verify</phase>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<quiet>true</quiet>
					<doclint>none</doclint>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>3.3.1</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<phase>verify</phase>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>3.2.5</version>
				<configuration>
					<skipTests>${skipTests}</skipTests>
				</configuration>
			</plugin>
		</plugins>
	</build>
	<profiles>
		<profile>
			<id>run-integration-tests</id>
			<properties>
				<skipTests>false</skipTests>
			</properties>
		</profile>
		<profile>
			<id>ossrh</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>3.2.4</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
								<configuration>
									<!-- Fixes "gpg: signing failed: Inappropriate ioctl for device" -->
									<!-- Prevent `gpg` from using pinentry programs -->
									<gpgArguments>
										<arg>--pinentry-mode</arg>
										<arg>loopback</arg>
									</gpgArguments>
								</configuration>
							</execution>
						</executions>
					</plugin>
					
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>1.6.13</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
							<!-- Sometimes OSSRH is really slow -->
							<stagingProgressTimeoutMinutes>30</stagingProgressTimeoutMinutes>
							<autoReleaseAfterClose>true</autoReleaseAfterClose>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>checkstyle</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-checkstyle-plugin</artifactId>
						<version>3.3.1</version>
						<dependencies>
							<dependency>
								<groupId>com.puppycrawl.tools</groupId>
								<artifactId>checkstyle</artifactId>
								<version>10.16.0</version>
							</dependency>
						</dependencies>
						<configuration>
							<configLocation>../.config/checkstyle/checkstyle.xml</configLocation>
							<includeTestSourceDirectory>true</includeTestSourceDirectory>
						</configuration>
						<executions>
							<execution>
								<goals>
									<goal>check</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
