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

	<parent>
		<groupId>io.github.solven-eu.pepper</groupId>
		<artifactId>pepper-parent</artifactId>
		<version>4.5</version>
		<relativePath>parent</relativePath>
	</parent>

	<artifactId>aggregator-pepper</artifactId>

	<packaging>pom</packaging>
	<inceptionYear>2014</inceptionYear>

	<modules>
		<!-- static resources like the Checkstyle sheet -->
		<module>static</module>

		<!-- Holds the java-agent enabling Instrumentation -->
		<module>agent</module>

		<!-- The java-core code -->
		<module>java</module>

		<!-- The java-core code relying on pepper-agent -->
		<module>java-with-agent</module>

		<module>map-path</module>

		<!-- This project metadata, holding for instance deployment resources -->
		<module>parent</module>

		<!-- Port Eclipse MAT in an autonomous module -->
		<!-- Not official module as it does not comply with quality standards yet -->
		<module>mat</module>

		<!-- Some JMH benchmarks, especially for Double parsing -->
		<module>jmh</module>

		<module>unittest</module>

		<module>serialization</module>
		<module>compression</module>

		<!-- <module>spark</module> -->

		<!-- Hadoop module, defining context for multiple modules (e.g. Spark, Parquet,..) -->
		<module>hadoop</module>

		<!-- Helps integration of a PostgreSQL database -->
		<module>pgsql</module>

		<!-- a JConsole plugin to facilitate tracking of off-heap -->
		<!-- Excluded as it is an experimental project -->
		<!-- <module>buffermonitor</module> -->
	</modules>

	<scm>
		<!-- Only developerConnection was not set in parent pom as its own parent was not a SNAPSHOT -->
		<developerConnection>${scm.developerConnection}</developerConnection>
		<tag>pepper-4.5</tag>
	</scm>

	<!-- Format source code -->
	<!-- mvn net.revelc.code.formatter:formatter-maven-plugin:2.8.0:format -->

	<!-- Add missing licenses -->
	<!-- mvn com.mycila:license-maven-plugin:format -->

	<!-- In case of 'gpg: signing failed: Timeout' -->
	<!-- Configure GPG -->
	<!-- https://central.sonatype.org/pages/working-with-pgp-signatures.html -->
	<!-- brew install gpg -->
	<!-- gpg \-\-gen-key -->
	<!-- gpg \-\-list-keys -->
	<!-- gpg \-\-keyserver http://pool.sks-keyservers.net:11371 \-\-send-keys <key_id> -->
	<!-- You may encounter IPv6 issues: trick for ipv4 -->
	<!-- gpg \-\-keyserver http://ipv4.pool.sks-keyservers.net:11371 \-\-send-keys <key_id> -->
	<!-- Then, maven release process will use this key to sign the artifacts uploaded to Sonatype -->

	<!-- In case of [ERROR] * No public key: Key with id: (<key_id>) -->
	<!-- gpg \-\-keyserver https://HOST_TO_BE_CORRECTED:11371 \-\-send-keys <key_id> -->

	<!-- If everything fails, try opening https://pool.sks-keyservers.net in your browser for manual submission -->
	<!-- gpg \-\-armor \-\-export keyId -->
	<!-- When searching the key manually, remember to add '0x' in front of the keys -->
	<!-- https://stackoverflow.com/questions/59380162/openpgpkeyserver-no-keys-found-after-submit-openpgp-public-key -->
	<!-- http://pool.sks-keyservers.net/pks/lookup?search=0xCB6E7A4E9502E68A&fingerprint=on&op=index -->

	<!-- DEPRECATED -->
	<!-- Deployment -->
	<!-- mvn deploy -PSonatype -Dmaven.test.skip -->
	<!-- Release in https://s01.oss.sonatype.org/ -->
	<!-- Jira ticket: https://issues.sonatype.org/browse/OSSRH-10350 -->
	<!-- Needs 2 hours to appear in http://search.maven.org/ -->

	<properties>
		<!-- https://github.com/google/guava/releases -->
		<!-- https://github.com/google/guava/wiki/Compatibility -->
		<!-- Guava for JDK6 drops at 28.1-jre -->
		<guava.version>31.1-jre</guava.version>

		<!-- https://mvnrepository.com/artifact/org.jooq/jool -->
		<jool.version>0.9.15</jool.version>

		<!-- https://github.com/google/guava-beta-checker -->
		<betachecker.version>1.0</betachecker.version>
		<errorprone.version>2.18.0</errorprone.version>

		<awaitility.version>4.0.3</awaitility.version>
		<equals.verifier.version>3.14.1</equals.verifier.version>
		<checker.quals.version>3.34.0</checker.quals.version>

		<!-- newer version than spring-boot-dependencies, for JDK11 -->
		<mockito.version>4.11.0</mockito.version>

		<jacoco.instruction.ratio>0.70</jacoco.instruction.ratio>
		<jacoco.branch.ratio>0.50</jacoco.branch.ratio>

		<!-- Used to define the Xmx of JVM popped by surefire -->
		<xmx>128M</xmx>
		<!-- http://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html -->
		<!-- We choose to fork to prevent AP License to complain -->
		<forkCount>1C</forkCount>

		<!-- TODO Exclude a few Sonar rules -->
		<!-- https://docs.sonarqube.org/display/SONAR/Analysis+Parameters#AnalysisParameters-Exclusions/Inclusions -->
	</properties>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>com.google.guava</groupId>
				<artifactId>guava</artifactId>
				<version>${guava.version}</version>
			</dependency>

			<dependency>
				<groupId>nl.jqno.equalsverifier</groupId>
				<artifactId>equalsverifier</artifactId>
				<version>${equals.verifier.version}</version>
				<scope>test</scope>
			</dependency>

			<!-- annotations from the Checker Framework: nullness, interning, locking, ... -->
			<dependency>
				<groupId>org.checkerframework</groupId>
				<artifactId>checker-qual</artifactId>
				<version>${checker.quals.version}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<!-- dependencies AFTER dependencyManagement -->
	<dependencies>
		<!-- Always added, to facilitate tests -->
		<dependency>
			<groupId>org.awaitility</groupId>
			<artifactId>awaitility</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.assertj</groupId>
			<artifactId>assertj-core</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>nl.jqno.equalsverifier</groupId>
			<artifactId>equalsverifier</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.checkerframework</groupId>
			<artifactId>checker-qual</artifactId>
		</dependency>

		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>

		<!-- Always added, to facilitate logging, as it is used by all modules -->
		<!-- Do not add logback, as the library user may prefer another logging framework -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
		</dependency>
	</dependencies>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<configuration>
						<!-- errorprone supports >=6 -->
						<source>${compiler.targetVersion}</source>
						<target>${compiler.targetVersion}</target>

						<!-- Fork to prevent PermGenOOM on a large build -->
						<fork>true</fork>

						<!-- https://github.com/google/guava-beta-checker -->
						<!-- We may prefer using http://overstock.github.io/library-detectors/usage.html -->

						<!-- We keep using @Beta for now... -->
						<!-- <compilerId>javac-with-errorprone</compilerId> -->
						<annotationProcessorPaths>
							<path>
								<groupId>com.google.guava</groupId>
								<artifactId>guava-beta-checker</artifactId>
								<version>${betachecker.version}</version>
							</path>
						</annotationProcessorPaths>

						<!-- Remove these compilerArgs to keep all checks enabled -->
						<compilerArgs>
							<!-- We keep using @Beta for now... -->
							<!-- <arg>-XepDisableAllChecks</arg> -->
							<!-- <arg>-Xep:BetaApi:ERROR</arg> -->
						</compilerArgs>
					</configuration>
					<dependencies>
						<dependency>
							<groupId>org.codehaus.plexus</groupId>
							<artifactId>plexus-compiler-javac-errorprone</artifactId>
							<version>2.13.0</version>
						</dependency>
						<!-- override plexus-compiler-javac-errorprone's dependency on Error Prone with the latest version -->
						<dependency>
							<groupId>com.google.errorprone</groupId>
							<artifactId>error_prone_core</artifactId>
							<version>${errorprone.version}</version>
						</dependency>
					</dependencies>
				</plugin>

				<!-- -Dtest=TestClassToFileMapped selects a single test class -->
				<!-- -Dmaven.surefire.debug enables debug on Surefire plugin on port 5005 -->
				<!-- mvn -Dtest=TestClassToFileMapped -Dmaven.surefire.debug test -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<configuration>
						<!-- Add ${argLine} to maintain the argument from Jacoco -->
						<!-- https://groups.google.com/forum/#!topic/jacoco/LzmCezW8VKA -->

						<!-- -XX:+StartAttachListener is for http://comments.gmane.org/gmane.comp.java.openjdk.macosx-port.devel/6094 -->
						<!-- -XX:-HeapDumpOnOutOfMemoryError because TestGCInspector will force an OOM -->
						<!-- -Djava.util.logging.config.file so that tests fallback on logback -->
						<!-- -Dio.netty.tryReflectionSetAccessible=true for Netty in Arrow (https://github.com/apache/arrow/pull/4522) -->
						<argLine><![CDATA[-ea -Xmx${xmx} -XX:+StartAttachListener -XX:-HeapDumpOnOutOfMemoryError -Djava.util.logging.config.file=logging.properties -Dio.netty.tryReflectionSetAccessible=true ${argLine}]]></argLine>

						<!-- Alternative safer configuration for 1JVM per test -->
						<!-- <forkCount>1</forkCount> -->
						<!-- <reuseForks>false</reuseForks> -->

						<!-- default is filesystem -->
						<runOrder>alphabetical</runOrder>
					</configuration>
				</plugin>

				<!-- http://maven.apache.org/surefire/maven-failsafe-plugin/examples/inclusion-exclusion.html -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-failsafe-plugin</artifactId>
					<configuration>
						<forkCount>1C</forkCount>
						<runOrder>alphabetical</runOrder>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<configuration>
						<encoding>${project.build.sourceEncoding}</encoding>
						<overwrite>true</overwrite>
					</configuration>
				</plugin>

				<!-- Add XXX-sources.jar in the repository -->
				<plugin>
					<!-- mvn source:jar -->
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<executions>
						<execution>
							<id>attach-sources</id>
							<goals>
								<goal>jar-no-fork</goal>
							</goals>
							<phase>verify</phase>
						</execution>
					</executions>
				</plugin>

				<!-- -Djacoco.skip=true -->
				<plugin>
					<groupId>org.jacoco</groupId>
					<artifactId>jacoco-maven-plugin</artifactId>
					<version>0.8.10</version>
					<executions>
						<execution>
							<id>default-prepare-agent</id>
							<goals>
								<goal>prepare-agent</goal>
							</goals>
						</execution>
						<execution>
							<id>default-report</id>
							<goals>
								<goal>report</goal>
							</goals>
							<phase>prepare-package</phase>
						</execution>
						<execution>
							<id>default-check</id>
							<goals>
								<goal>check</goal>
							</goals>
							<configuration>
								<rules>
									<rule implementation="org.jacoco.maven.RuleConfiguration">
										<!-- BUNDLE, PACKAGE, CLASS, SOURCEFILE or METHOD -->
										<element>BUNDLE</element>
										<limits>
											<limit implementation="org.jacoco.report.check.Limit">
												<!-- INSTRUCTION, LINE, BRANCH, COMPLEXITY, METHOD, CLASS -->
												<counter>BRANCH</counter>
												<!-- TOTALCOUNT, COVEREDCOUNT, MISSEDCOUNT, COVEREDRATIO, MISSEDRATIO -->
												<value>COVEREDRATIO</value>
												<minimum>${jacoco.branch.ratio}</minimum>
											</limit>
											<limit implementation="org.jacoco.report.check.Limit">
												<!-- INSTRUCTION, LINE, BRANCH, COMPLEXITY, METHOD, CLASS -->
												<counter>INSTRUCTION</counter>
												<!-- TOTALCOUNT, COVEREDCOUNT, MISSEDCOUNT, COVEREDRATIO, MISSEDRATIO -->
												<value>COVEREDRATIO</value>
												<minimum>${jacoco.instruction.ratio}</minimum>
											</limit>
										</limits>
									</rule>
								</rules>
							</configuration>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<!-- Usage: mvn com.mycila:license-maven-plugin:format -->
					<groupId>com.mycila</groupId>
					<artifactId>license-maven-plugin</artifactId>
					<version>4.2</version>
					<configuration>
						<header>com/mycila/maven/plugin/license/templates/MIT.txt</header>
						<properties>
							<owner>Benoit Lacelle</owner>
							<year>2017</year>
							<email>benoit.lacelle@gmail.com</email>
						</properties>
						<excludes>
							<exclude>**/*.xml</exclude>
							<exclude>**/*.log</exclude>
							<exclude>**/*.hprof</exclude>
							<exclude>**/*.versionsBackup</exclude>
							<exclude>**/*.csv</exclude>
							<exclude>**/*.html</exclude>
							<exclude>**/README</exclude>
							<exclude>src/test/resources/**</exclude>
							<exclude>src/main/resources/**</exclude>
							<exclude>target/**</exclude>
							<exclude>war/**</exclude>
							<exclude>gwt-unitCache/**</exclude>
						</excludes>
					</configuration>
					<executions>
						<execution>
							<goals>
								<goal>check</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<configuration>
						<!-- Prevent git to clone the whole repo which is quite slow -->
						<!-- https://issues.apache.org/jira/browse/MRELEASE-777 -->
						<localCheckout>true</localCheckout>
						<!-- True, else tags, and the updaded SNAPSHOT are not pushed -->
						<pushChanges>true</pushChanges>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>

		<plugins>
			<plugin>
				<!-- –Djacoco.skip=true -->
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
			</plugin>

			<plugin>
				<!-- http://maven.apache.org/maven-release/maven-release-plugin/usage.html -->
				<!-- mvn clean install -Pfull -->
				<!-- mvn release:clean release:prepare -Darguments="-DskipTests" -->
				<!-- mvn release:perform -Darguments="-Dmaven.test.skip" -->
				<!-- git reset \-\-hard SOMESHA1 -->
				<!-- git push force -->
				<!-- git tag -d 12345 -->
				<!-- git push origin :refs/tags/12345 -->
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<configuration>
					<autoVersionSubmodules>true</autoVersionSubmodules>
					<tagNameFormat>pepper-@{project.version}</tagNameFormat>

					<!-- http://central.sonatype.org/pages/apache-maven.html -->
					<!-- Sonatype profile is defined in pepper-metadata -->
					<releaseProfiles>Sonatype</releaseProfiles>

					<!-- On each release, push the jars to Maven Central -->
					<goals>deploy</goals>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<configuration>
					<!-- https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8212233 -->
					<source>8</source>
					<defaultAuthor>Benoit Lacelle</defaultAuthor>
					<failOnError>false</failOnError>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>
