<?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>com.github.cowwoc.requirements</groupId>
	<artifactId>root</artifactId>
	<version>8.0.4</version>
	<packaging>pom</packaging>
	<name>Requirements</name>
	<description>A fluent API for enforcing design contracts with automatic message generation</description>
	<url>https://github.com/cowwoc/requirements.java/</url>

	<licenses>
		<license>
			<name>The Apache Software License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<scm>
		<url>https://github.com/cowwoc/requirements.java/</url>
		<connection>scm:git:https://github.com/cowwoc/requirements.java/</connection>
		<developerConnection>scm:git:https://github.com/cowwoc/requirements.java/</developerConnection>
		<tag>HEAD</tag>
	</scm>

	<developers>
		<developer>
			<id>cowwoc</id>
			<name>Gili Tzabari</name>
			<email>cowwoc2020@gmail.com</email>
		</developer>
	</developers>

	<distributionManagement>
		<snapshotRepository>
			<id>maven-central-snapshots</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>maven-central-releases</id>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
		</repository>
	</distributionManagement>

	<modules>
		<module>annotations</module>
		<module>natives</module>
		<module>code_generator</module>
		<module>maven_plugin</module>
		<module>java</module>
		<module>guava</module>
	</modules>

	<properties>
		<!--		<license.verbose>true</license.verbose>-->
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.release>17</maven.compiler.release>
		<maven.version>3.6.1</maven.version>
		<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
		<maven-javadoc-plugin.version>3.4.1</maven-javadoc-plugin.version>
		<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
		<guava.version>31.1-jre</guava.version>
		<slf4j.version>2.0.1</slf4j.version>
		<logback.version>1.4.1</logback.version>
		<testng.version>7.6.1</testng.version>
		<pouch.version>2.1</pouch.version>
		<jmh.version>1.35</jmh.version>
	</properties>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>annotations</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>benchmark</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>code_generator</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>java</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>guava</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>${project.groupId}</groupId>
				<artifactId>natives</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>com.google.guava</groupId>
				<artifactId>guava</artifactId>
				<version>${guava.version}</version>
			</dependency>
			<dependency>
				<groupId>org.openjdk.jmh</groupId>
				<artifactId>jmh-core</artifactId>
				<version>${jmh.version}</version>
			</dependency>
			<dependency>
				<groupId>org.openjdk.jmh</groupId>
				<artifactId>jmh-generator-annprocess</artifactId>
				<version>${jmh.version}</version>
			</dependency>
			<dependency>
				<groupId>ch.qos.logback</groupId>
				<artifactId>logback-classic</artifactId>
				<version>${logback.version}</version>
			</dependency>
			<dependency>
				<groupId>org.testng</groupId>
				<artifactId>testng</artifactId>
				<version>${testng.version}</version>
			</dependency>
			<dependency>
				<groupId>com.github.javaparser</groupId>
				<artifactId>javaparser-core</artifactId>
				<version>3.24.4</version>
			</dependency>
			<dependency>
				<groupId>io.github.java-diff-utils</groupId>
				<artifactId>java-diff-utils</artifactId>
				<version>4.12</version>
			</dependency>
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>${slf4j.version}</version>
			</dependency>
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-simple</artifactId>
				<version>${slf4j.version}</version>
			</dependency>
			<dependency>
				<groupId>com.github.cowwoc.pouch</groupId>
				<artifactId>core</artifactId>
				<version>${pouch.version}</version>
			</dependency>
			<dependency>
				<groupId>org.twdata.maven</groupId>
				<artifactId>mojo-executor</artifactId>
				<version>2.4.0</version>
			</dependency>
			<dependency>
				<groupId>aopalliance</groupId>
				<artifactId>aopalliance</artifactId>
				<version>1.0</version>
			</dependency>
			<dependency>
				<groupId>org.apache.maven</groupId>
				<artifactId>maven-core</artifactId>
				<version>3.8.6</version>
			</dependency>
			<dependency>
				<groupId>org.apache.maven.plugin-tools</groupId>
				<artifactId>maven-plugin-annotations</artifactId>
				<version>3.6.4</version>
			</dependency>
			<dependency>
				<groupId>org.apache.maven</groupId>
				<artifactId>maven-plugin-api</artifactId>
				<version>3.8.6</version>
			</dependency>
			<dependency>
				<groupId>org.apache.maven</groupId>
				<artifactId>maven-model</artifactId>
				<version>3.8.6</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>com.github.cowwoc.requirements</groupId>
					<artifactId>maven_plugin</artifactId>
					<version>${project.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<version>3.0.0-M6</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.10.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>${maven-javadoc-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>${maven-source-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>${maven-gpg-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>3.0.0-M7</version>
				</plugin>
				<plugin>
					<artifactId>maven-antrun-plugin</artifactId>
					<version>3.1.0</version>
				</plugin>
				<plugin>
					<artifactId>maven-clean-plugin</artifactId>
					<version>3.2.0</version>
				</plugin>
				<plugin>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>3.0.0</version>
				</plugin>
				<plugin>
					<artifactId>maven-install-plugin</artifactId>
					<version>3.0.1</version>
				</plugin>
				<plugin>
					<artifactId>maven-site-plugin</artifactId>
					<version>4.0.0-M3</version>
				</plugin>
				<plugin>
					<artifactId>maven-jar-plugin</artifactId>
					<version>3.3.0</version>
				</plugin>
				<plugin>
					<artifactId>maven-resources-plugin</artifactId>
					<version>3.3.0</version>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>build-helper-maven-plugin</artifactId>
					<version>3.3.0</version>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>license-maven-plugin</artifactId>
					<version>2.0.0</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-plugin-plugin</artifactId>
					<version>3.6.4</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-dependency-plugin</artifactId>
					<version>3.3.0</version>
				</plugin>
			</plugins>
		</pluginManagement>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<version>3.1.0</version>
				<executions>
					<execution>
						<id>enforce-maven</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<requireMavenVersion>
									<version>${maven.version}</version>
								</requireMavenVersion>
							</rules>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>3.0.0-M6</version>
				<configuration>
					<autoVersionSubmodules>true</autoVersionSubmodules>
					<tagNameFormat>release-@{project.version}</tagNameFormat>
				</configuration>
			</plugin>
			<plugin>
				<!--
				Cannot be hidden behind the "deploy" profile because we invoke "rc-open" and "rc-close" before and
				after the deploy.
				-->
				<groupId>org.sonatype.plugins</groupId>
				<artifactId>nexus-staging-maven-plugin</artifactId>
				<version>1.6.13</version>
				<extensions>true</extensions>
				<configuration>
					<serverId>maven-central-releases</serverId>
					<nexusUrl>https://oss.sonatype.org/</nexusUrl>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.10.1</version>
				<configuration>
					<showWarnings>true</showWarnings>
					<showDeprecation>true</showDeprecation>
					<compilerArgs>
						<arg>-Xdiags:verbose</arg>
						<arg>-Werror</arg>
					</compilerArgs>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>${maven-javadoc-plugin.version}</version>
				<executions>
					<execution>
						<id>default-cli</id>
						<goals>
							<goal>aggregate</goal>
						</goals>
						<!-- Reminder: Use "-pl !test,!benchmark" to exclude test modules -->
						<configuration>
							<show>public</show>
							<additionalOptions>
								<!--
								Maven plugins cannot be full-fledged modules due to Maven's use of split packages.
								automatic-modules are treated as unnamed modules so we need to explicitly export packages
								to them.
								-->
								<option>--add-modules</option>
								<option>java.xml</option>
								<!-- https://stackoverflow.com/a/54468139/14731 -->
								<option>--override-methods</option>
								<option>summary</option>
							</additionalOptions>
							<links>
								<!--								<link>https://guava.dev/releases/${guava.version}/api/docs/</link>-->
								<!-- WORKAROUND: https://github.com/google/guava/issues/5653 -->
								<link>https://guava.dev/releases/29.0-jre/api/docs/</link>
							</links>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>license-maven-plugin</artifactId>
				<version>2.0.0</version>
				<executions>
					<execution>
						<id>3rd-party-licenses</id>
						<goals>
							<goal>aggregate-add-third-party</goal>
						</goals>
						<phase>process-sources</phase>
						<configuration>
							<outputDirectory>${project.basedir}</outputDirectory>
							<thirdPartyFilename>LICENSE-3RD-PARTY.md</thirdPartyFilename>
							<fileTemplate>${basedir}/licenses/format.ftl</fileTemplate>
							<missingFile>${basedir}/licenses/missing.txt</missingFile>
							<overrideUrl>file:${basedir}/licenses/override.txt</overrideUrl>
							<licenseMerges>
								<licenseMerge>Apache License, Version 2.0|Apache 2.0|Apache License, Version 2.0, GNU Lesser
									General Public License|The Apache Software License, Version 2.0
								</licenseMerge>
								<licenseMerge>Eclipse Public License (EPL), Version 1.0|Eclipse Public License - v 1.0|Eclipse
									Public License - v 1.0, GNU Lesser General Public License|Eclipse Public License, Version
									1.0
								</licenseMerge>
								<licenseMerge>MIT License|The MIT License</licenseMerge>
								<licenseMerge>GNU Lesser General Public License (LGPL)|GNU Lesser General Public License
								</licenseMerge>
								<licenseMerge>Common Development And Distribution License (CDDL) + GPL, version 2.0, with
									classpath exception|CDDL + GPLv2 with classpath exception
								</licenseMerge>
							</licenseMerges>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>list-profiles</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-antrun-plugin</artifactId>
						<version>3.1.0</version>
						<executions>
							<execution>
								<phase>validate</phase>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<tasks>
										<echo>Please pick one of the following profiles:</echo>
										<echo>* windows-x86_64-debug</echo>
										<echo>* windows-x86_64-release</echo>
										<echo>* linux-x86_64-debug</echo>
										<echo>* linux-x86_64-release</echo>
										<echo>* mac-x86_64-debug</echo>
										<echo>* mac-x86_64-release</echo>
										<echo/>
										<echo>For instance: mvn -Pwindows-x86_64-debug install</echo>
										<fail/>
									</tasks>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>windows-x86_64-debug</id>
			<properties>
				<platform>windows-x86_64</platform>
				<build.type>debug</build.type>
			</properties>
		</profile>
		<profile>
			<id>windows-x86_64-release</id>
			<activation>
				<os>
					<family>windows</family>
					<arch>amd64</arch>
				</os>
			</activation>
			<properties>
				<platform>windows-x86_64</platform>
				<build.type>release</build.type>
			</properties>
		</profile>
		<profile>
			<id>linux-x86_64-debug</id>
			<properties>
				<platform>linux-x86_64</platform>
				<build.type>debug</build.type>
			</properties>
		</profile>
		<profile>
			<id>linux-x86_64-release</id>
			<activation>
				<os>
					<family>linux</family>
					<arch>amd64</arch>
				</os>
			</activation>
			<properties>
				<platform>linux-x86_64</platform>
				<build.type>release</build.type>
			</properties>
		</profile>
		<profile>
			<id>mac-x86_64-debug</id>
			<properties>
				<platform>mac-x86_64</platform>
				<build.type>debug</build.type>
			</properties>
		</profile>
		<profile>
			<id>mac-x86_64-release</id>
			<activation>
				<os>
					<family>mac</family>
					<arch>x86_64</arch>
				</os>
			</activation>
			<properties>
				<platform>mac-x86_64</platform>
				<build.type>release</build.type>
			</properties>
		</profile>
		<profile>
			<id>deploy</id>
			<!--
			Must use property-based activation because there is no way to activate no-deploy profile without it.
			See https://stackoverflow.com/a/7481347/14731
			-->
			<activation>
				<property>
					<name>deploy</name>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<version>${maven-source-plugin.version}</version>
						<executions>
							<execution>
								<id>attach-sources</id>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>${maven-javadoc-plugin.version}</version>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>${maven-gpg-plugin.version}</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
								<configuration>
									<!-- See https://maven.apache.org/guides/mini/guide-encryption.html -->
									<passphraseServerId>gpg.passphrase</passphraseServerId>
									<!-- See https://stackoverflow.com/a/53992951/14731 -->
									<gpgArguments>
										<arg>--pinentry-mode</arg>
										<arg>loopback</arg>
									</gpgArguments>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>no-deploy</id>
			<!--
			According to https://github.com/sonatype/nexus-maven-plugins/tree/master/staging/maven-plugin
			skipNexusStagingDeployMojo may not be set to true in the last reactor module. Because we don't
			want to deploy our last module, nor a dummy module, we simply omit the relevant modules when
			a deploy is in progress.
			-->
			<activation>
				<property>
					<name>!deploy</name>
				</property>
			</activation>
			<modules>
				<module>generated_api</module>
				<module>test</module>
				<module>benchmark</module>
				<module>wiki</module>
			</modules>
		</profile>
	</profiles>
</project>