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

    Copyright © 2009 HotPads (admin@hotpads.com)

    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

        http://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>io.datarouter</groupId>
		<artifactId>datarouter-metadata-parent</artifactId>
		<version>0.0.107</version>
		<relativePath>../datarouter-metadata-parent</relativePath>
	</parent>

	<artifactId>datarouter-parent</artifactId>
	<packaging>pom</packaging>

	<name>datarouter-parent</name>
	<description>datarouter-parent</description>

	<properties>
		<!-- libraries -->
		<aws-sdk-version>1.12.136</aws-sdk-version>
		<aws-sdk-software-v2-version>2.17.108</aws-sdk-software-v2-version>
		<codehaus-plexus-version>2.9.0</codehaus-plexus-version>
		<commons-codec-version>1.15</commons-codec-version>
		<commons-io-version>2.11.0</commons-io-version>
		<datarouter-version>0.0.107</datarouter-version>
		<gson-version>2.8.9</gson-version>
		<guice-version>5.0.1</guice-version>
		<guava-version>31.0.1-jre</guava-version>
		<httpclient-version>4.5.13</httpclient-version>
		<log4j-version>2.17.1</log4j-version>
		<mockito-core-version>4.2.0</mockito-core-version>
		<slf4j-version>1.7.33</slf4j-version>
		<testng-version>7.3.0</testng-version>

		<!-- plugins -->
		<maven-jar-plugin-version>3.2.0</maven-jar-plugin-version>
		<maven-checkstyle-plugin-version>3.1.2</maven-checkstyle-plugin-version>
		<maven-compiler-plugin-version>3.8.1</maven-compiler-plugin-version>
		<maven-resources-plugin-version>3.2.0</maven-resources-plugin-version>

		<!-- other -->
		<!-- upgrade scripts when bumping this version -->
		<eclipse-compiler-version>3.28.0</eclipse-compiler-version>
	</properties>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>com.google.guava</groupId>
				<artifactId>guava</artifactId>
				<version>${guava-version}</version>
			</dependency>
			<dependency>
				<groupId>com.google.cloud</groupId>
				<artifactId>libraries-bom</artifactId>
				<version>21.0.0</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>ru.yaal.maven</groupId>
				<artifactId>write-text-files-maven-plugin</artifactId>
				<version>1.1</version>
				<executions>
					<execution>
						<phase>prepare-package</phase>
						<goals>
							<goal>write-text-files</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<files>
						<file>
							<path>target/classes/build.properties</path>
							<lines>
								<line>buildId=${env.BUILD_NUMBER}</line>
							</lines>
						</file>
					</files>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>pl.project13.maven</groupId>
				<artifactId>git-commit-id-plugin</artifactId>
				<version>4.0.5</version>
				<executions>
					<execution>
						<goals>
							<goal>revision</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<generateGitPropertiesFile>true</generateGitPropertiesFile>
					<useNativeGit>true</useNativeGit>
					<abbrevLength>10</abbrevLength>
					<includeOnlyProperties>
						<includeOnlyProperties>git.branch</includeOnlyProperties>
						<includeOnlyProperties>git.commit.id.abbrev</includeOnlyProperties>
						<includeOnlyProperties>git.commit.id</includeOnlyProperties>
						<includeOnlyProperties>git.commit.id.describe-short</includeOnlyProperties>
						<includeOnlyProperties>git.commit.time</includeOnlyProperties>
						<includeOnlyProperties>git.commit.user.name</includeOnlyProperties>
						<includeOnlyProperties>git.build.time</includeOnlyProperties>
					</includeOnlyProperties>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<version>${maven-checkstyle-plugin-version}</version>
				<executions>
					<execution>
						<goals>
							<goal>check</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<violationSeverity>warning</violationSeverity>
					<failOnViolation>true</failOnViolation>
					<configLocation>datarouter-checkstyle.xml</configLocation>
					<includeTestSourceDirectory>true</includeTestSourceDirectory>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>com.puppycrawl.tools</groupId>
						<artifactId>checkstyle</artifactId>
						<version>9.2.1</version>
					</dependency>
					<dependency>
						<groupId>io.datarouter</groupId>
						<artifactId>datarouter-checkstyle</artifactId>
						<version>${datarouter-version}</version>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-enforcer-plugin</artifactId>
					<version>3.0.0</version>
					<executions>
						<execution>
							<phase>none</phase>
							<goals>
								<goal>enforce</goal>
							</goals>
							<configuration>
								<rules>
									<requireMavenVersion>
										<version>3.6.0</version>
									</requireMavenVersion>
								</rules>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>${maven-compiler-plugin-version}</version>
					<configuration>
						<compilerId>eclipse</compilerId>
						<source>14</source>
						<target>14</target>
						<optimize>true</optimize>
						<fork>true</fork>
						<parameters>true</parameters>
						<compilerArgs>
<!-- https://git.eclipse.org/c/jdt/eclipse.jdt.core.git/tree/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java#n4116 -->
							<arg>-err:+enumSwitch</arg>
							<arg>-err:+deadCode</arg>
							<arg>-err:+noEffectAssign</arg>
							<arg>-err:+serial</arg>
							<arg>-err:+staticReceiver</arg>
							<arg>-err:+suppress</arg>
							<arg>-err:+unlikelyCollectionMethodArgumentType</arg>
							<arg>-err:+unlikelyEqualsArgumentType</arg>
							<arg>-err:+unusedTypeArgs</arg>
						</compilerArgs>
					</configuration>
					<dependencies>
						<dependency>
							<groupId>org.codehaus.plexus</groupId>
							<artifactId>plexus-compiler-eclipse</artifactId>
							<version>${codehaus-plexus-version}</version>
						</dependency>
						<dependency> <!-- https://github.com/codehaus-plexus/plexus-compiler/issues/162 https://github.com/codehaus-plexus/plexus-compiler/issues/166 -->
							<groupId>org.codehaus.plexus</groupId>
							<artifactId>plexus-compiler-api</artifactId>
							<version>${codehaus-plexus-version}</version>
						</dependency>
						<dependency>
							<groupId>org.eclipse.jdt</groupId>
							<artifactId>ecj</artifactId>
							<version>${eclipse-compiler-version}</version>
						</dependency>
					</dependencies>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>3.0.0-M1</version>
					<executions>
						<execution>
							<id>default-test</id>
							<phase>none</phase>
						</execution>
						<execution>
							<goals>
								<goal>test</goal>
							</goals>
							<id>src/main unit test</id>
							<configuration>
								<testClassesDirectory>${project.basedir}/target/classes/</testClassesDirectory>
							</configuration>
						</execution>
						<execution>
							<goals>
								<goal>test</goal>
							</goals>
							<id>src/test unit test</id>
							<configuration>
								<testClassesDirectory>${project.basedir}/target/test-classes/</testClassesDirectory>
							</configuration>
						</execution>
					</executions>
					<configuration>
						<includes>
							<include>**/*Tests.class</include>
						</includes>
						<excludes>
							<exclude>**/*IntegrationTests.class</exclude>
						</excludes>
						<reportFormat>plain</reportFormat>
						<trimStackTrace>false</trimStackTrace>
						<argLine>-Djava.awt.headless=true</argLine>
						<enableAssertions>false</enableAssertions>
						<systemPropertyVariables>
							<testng.dtd.http>true</testng.dtd.http>
						</systemPropertyVariables>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-failsafe-plugin</artifactId>
					<version>3.0.0-M5</version>
					<executions>
						<execution>
							<goals>
								<goal>integration-test</goal>
								<goal>verify</goal>
							</goals>
							<id>src/main integration test</id>
							<configuration>
								<testClassesDirectory>${project.basedir}/target/classes/</testClassesDirectory>
							</configuration>
						</execution>
						<execution>
							<goals>
								<goal>integration-test</goal>
								<goal>verify</goal>
							</goals>
							<id>src/test integration test</id>
							<configuration>
								<testClassesDirectory>${project.basedir}/target/test-classes/</testClassesDirectory>
							</configuration>
						</execution>
					</executions>
					<configuration>
						<testClassesDirectory>${project.basedir}/target/classes/</testClassesDirectory>
						<forkCount>1C</forkCount><!-- fork is a JVM.  the C multiplies by number of cores -->
						<reuseForks>true</reuseForks>
						<threadCount>2</threadCount>
						<parallel>classesAndMethods</parallel>
						<includes>
							<include>**/*IntegrationTests.class</include>
						</includes>
						<excludes>
							<!-- override the default surefire excludes to be able to run inner test classes -->
							<exclude></exclude>
						</excludes>
						<reportFormat>plain</reportFormat>
						<trimStackTrace>false</trimStackTrace>
						<argLine>-Djava.awt.headless=true</argLine>
						<enableAssertions>false</enableAssertions>
						<systemPropertyVariables>
							<testng.dtd.http>true</testng.dtd.http>
						</systemPropertyVariables>
					</configuration>
				</plugin>
				<plugin>
					<groupId>com.mycila</groupId>
					<artifactId>license-maven-plugin</artifactId>
					<version>4.1</version>
					<configuration>
						<header>com/mycila/maven/plugin/license/templates/APACHE-2.txt</header>
						<properties>
							<owner>HotPads</owner>
							<email>admin@hotpads.com</email>
						</properties>
						<excludes>
							<exclude>src/main/resources/**</exclude>
						</excludes>
					</configuration>
					<executions>
						<execution>
							<phase>test</phase>
							<goals>
								<goal>check</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>3.2.1</version>
					<executions>
						<execution>
							<goals>
								<goal>jar-no-fork</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>3.3.0</version>
					<executions>
						<execution>
							<goals>
								<goal>jar</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-war-plugin</artifactId>
					<version>3.3.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-clean-plugin</artifactId>
					<version>3.1.0</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>3.0.0-M1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-install-plugin</artifactId>
					<version>3.0.0-M1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>3.2.0</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<version>${maven-resources-plugin-version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-site-plugin</artifactId>
					<version>3.9.1</version>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
</project>
