<?xml version="1.0" encoding="UTF-8"?>
<!--
	GlobalMentor, Inc. Root POM
	Copyright © 2018 GlobalMentor, Inc. (http://www.globalmentor.com/)

	The following properties will be set:
	
	`project.releaseVersion`
	: The version to use for release, without any qualifiers, as per [Semantic Versioning 2.0.0 Item 9](https://semver.org/#spec-item-9).
	  For example, both `1.2.3-SNAPSHOT` and `1.2.3-beta.4` yield a release version of `1.2.3`.
	`build.year`
	: The year in which the project was built, in UTC; a string in the format `YYYY`. 
	`build.date`
	: The date on which the project was built, in UTC; a string in the format `YYYY-MM-DD`. 
 -->
<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.globalmentor</groupId>
	<artifactId>globalmentor-root</artifactId>
	<version>0.8.5</version>
	<packaging>pom</packaging>

	<name>GlobalMentor Root</name>
	<description>GlobalMentor root POM.</description>
	<url>http://www.globalmentor.com/software/</url>

	<organization>
		<name>GlobalMentor, Inc.</name>
		<url>http://www.globalmentor.com/</url>
	</organization>

	<developers>
		<developer>
			<name>Garret Wilson</name>
			<email>garret@globalmentor.com</email>
			<organization>GlobalMentor, Inc.</organization>
			<organizationUrl>http://www.globalmentor.com/</organizationUrl>
		</developer>
	</developers>

	<licenses>
		<license>
			<name>Apache License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<scm>
		<connection>scm:git:https://bitbucket.org/globalmentor/globalmentor-pom.git</connection>
		<developerConnection>scm:git:https://bitbucket.org/globalmentor/globalmentor-pom.git</developerConnection>
		<url>https://bitbucket.org/globalmentor/globalmentor-pom</url>
	</scm>

	<modules>
		<module>../root-opensource</module>
	</modules>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<gpg.keyname>software@globalmentor.com</gpg.keyname>
		<mockito.version>2.27.0</mockito.version>
		<junit.version>5.4.0</junit.version>
		<hamcrest.version>2.1</hamcrest.version>
		<!-- set if generating executable JAR and exe file
			<exe.main.class>com.example.cli.Example</exe.main.class>
		-->
		<exe.filename>${project.artifactId}.exe</exe.filename>
	</properties>

	<dependencies>
		<dependency>
			<groupId>com.google.code.findbugs</groupId>
			<artifactId>jsr305</artifactId>
			<optional>true</optional>
		</dependency>

		<!-- test scope dependencies -->

		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-engine</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.junit.vintage</groupId>
			<artifactId>junit-vintage-engine</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest-core</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>com.github.npathai</groupId>
			<artifactId>hamcrest-optional</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-simple</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>com.github.npathai</groupId>
				<artifactId>hamcrest-optional</artifactId>
				<version>2.0.0</version>
			</dependency>

			<dependency>
				<groupId>com.google.code.findbugs</groupId>
				<artifactId>jsr305</artifactId>
				<version>3.0.2</version>
			</dependency>

			<dependency>
				<groupId>org.junit.jupiter</groupId>
				<artifactId>junit-jupiter-engine</artifactId>
				<version>${junit.version}</version>
			</dependency>

			<dependency>
				<groupId>org.junit.vintage</groupId>
				<artifactId>junit-vintage-engine</artifactId>
				<version>${junit.version}</version>
			</dependency>

			<dependency>
				<groupId>org.hamcrest</groupId>
				<artifactId>hamcrest</artifactId>
				<version>${hamcrest.version}</version>
			</dependency>

			<!-- 
				This dependency was included so JUnit Vintage, i.e., Junit `4.12`, doesn't pull in the outdated version `1.3` of `hamcrest-core`.
				This should be removed whenever JUnit Vintage is removed as well.

				See [Hamcrest Issue #224](https://github.com/hamcrest/JavaHamcrest/issues/224).
			-->
			<dependency>
				<groupId>org.hamcrest</groupId>
				<artifactId>hamcrest-core</artifactId>
				<version>${hamcrest.version}</version>
			</dependency>

			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-simple</artifactId>
				<version>1.7.25</version>
			</dependency>

			<dependency>
				<groupId>org.mockito</groupId>
				<artifactId>mockito-core</artifactId>
				<version>${mockito.version}</version>
			</dependency>

			<dependency>
				<groupId>org.zalando</groupId>
				<artifactId>faux-pas</artifactId>
				<version>0.8.0</version>
			</dependency>

			<dependency>
				<groupId>javax.servlet</groupId>
				<artifactId>javax.servlet-api</artifactId>
				<version>4.0.1</version>
			</dependency>

			<dependency>
				<groupId>javax.ws.rs</groupId>
				<artifactId>javax.ws.rs-api</artifactId>
				<version>2.1.1</version>
			</dependency>

			<dependency>
				<groupId>javax.servlet.jsp</groupId>
				<artifactId>javax.servlet.jsp-api</artifactId>
				<version>2.3.3</version>
			</dependency>

			<dependency>
				<groupId>javax.servlet</groupId>
				<artifactId>jstl</artifactId>
				<version>1.2</version>
			</dependency>

			<dependency>
				<groupId>javax.faces</groupId>
				<artifactId>javax.faces-api</artifactId>
				<version>2.2</version>
				<scope>provided</scope>
			</dependency>

			<dependency>
				<groupId>javax.el</groupId>
				<artifactId>javax.el-api</artifactId>
				<version>3.0.0</version>
				<scope>provided</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>com.akathist.maven.plugins.launch4j</groupId>
					<artifactId>launch4j-maven-plugin</artifactId>
					<version>1.7.25</version>
					<executions>
						<execution>
							<phase>package</phase>
							<goals>
								<goal>launch4j</goal>
							</goals>
							<configuration>
								<headerType>console</headerType>
								<outfile>${project.build.directory}/${exe.filename}</outfile>
								<jar>${project.build.directory}/${project.artifactId}-${project.version}-exe.jar</jar>
								<errTitle>${project.name}</errTitle>
								<jre>
									<minVersion>${maven.compiler.release}</minVersion>
								</jre>
								<versionInfo>
									<fileVersion>${project.releaseVersion}.0</fileVersion>
									<txtFileVersion>${project.version}</txtFileVersion>
									<fileDescription>${project.description}</fileDescription>
									<copyright>Copyright © ${project.inceptionYear}-${build.year} ${project.organization.name}. All rights reserved.</copyright>
									<productName>${project.name}</productName>
									<internalName>${project.artifactId}</internalName>
									<productVersion>${project.releaseVersion}.0</productVersion>
									<txtProductVersion>${project.version}</txtProductVersion>
									<originalFilename>${exe.filename}</originalFilename>
								</versionInfo>
							</configuration>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.8.0</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-enforcer-plugin</artifactId>
					<version>3.0.0-M2</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-failsafe-plugin</artifactId>
					<version>2.22.1</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>1.6</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>3.1.0</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>3.0.1</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-shade-plugin</artifactId>
					<version>3.2.1</version>
					<executions>
						<execution>
							<goals>
								<goal>shade</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<shadedArtifactAttached>true</shadedArtifactAttached>
						<shadedClassifierName>exe</shadedClassifierName>
						<transformers>
							<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
								<mainClass>${exe.main.class}</mainClass>
							</transformer>
							<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
						</transformers>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>3.0.1</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.22.1</version>
				</plugin>

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>build-helper-maven-plugin</artifactId>
					<version>3.0.0</version>
				</plugin>

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>versions-maven-plugin</artifactId>
					<version>2.7</version>
				</plugin>

				<plugin>
					<groupId>org.sonatype.plugins</groupId>
					<artifactId>nexus-staging-maven-plugin</artifactId>
					<version>1.6.8</version>
					<extensions>true</extensions>
					<configuration>
						<serverId>ossrh</serverId>
						<nexusUrl>https://oss.sonatype.org/</nexusUrl>
						<autoReleaseAfterClose>true</autoReleaseAfterClose>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-war-plugin</artifactId>
					<version>3.2.2</version>
				</plugin>
			</plugins>
		</pluginManagement>

		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>set-project-release-version</id>
						<goals>
							<goal>regex-property</goal>
						</goals>
						<configuration>
							<name>project.releaseVersion</name>
							<value>${project.version}</value>
							<regex>-.*</regex>
							<failIfNoMatch>false</failIfNoMatch>
						</configuration>
					</execution>
					<execution>
						<id>set-build-year</id>
						<goals>
							<goal>timestamp-property</goal>
						</goals>
						<configuration>
							<locale>en</locale>
							<timeZone>UTC</timeZone>
							<name>build.year</name>
							<pattern>yyyy</pattern>
						</configuration>
					</execution>
					<execution>
						<id>set-build-date</id>
						<goals>
							<goal>timestamp-property</goal>
						</goals>
						<configuration>
							<locale>en</locale>
							<timeZone>UTC</timeZone>
							<name>build.date</name>
							<pattern>yyyy-MM-dd</pattern>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<executions>
					<execution>
						<id>enforce-maven</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<requireMavenVersion>
									<version>3.0.5</version>
								</requireMavenVersion>
							</rules>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>integration-test</goal>
							<goal>verify</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>versions-maven-plugin</artifactId>
			</plugin>

			<plugin>
				<groupId>org.sonatype.plugins</groupId>
				<artifactId>nexus-staging-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>

	<profiles>
		<profile>
			<id>release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<executions>
							<execution>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<configuration>
							<quiet>true</quiet>
							<detectOfflineLinks>false</detectOfflineLinks>
							<tags>
								<tag>
									<name>apiNote</name>
									<placement>a</placement>
									<head>API Note:</head>
								</tag>
								<tag>
									<name>implSpec</name>
									<placement>a</placement>
									<head>Implementation Specification:</head>
								</tag>
								<tag>
									<name>implNote</name>
									<placement>a</placement>
									<head>Implementation Note:</head>
								</tag>
								<tag>
									<name>param</name>
								</tag>
								<tag>
									<name>return</name>
								</tag>
								<tag>
									<name>throws</name>
								</tag>
								<tag>
									<name>since</name>
								</tag>
								<tag>
									<name>version</name>
								</tag>
								<tag>
									<name>serialData</name>
								</tag>
								<tag>
									<name>see</name>
								</tag>
							</tags>
						</configuration>
						<executions>
							<execution>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<executions>
							<execution>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
