<?xml version="1.0" encoding="UTF-8"?>
<!--
GlobalMentor, Inc. Root POM
Copyright © 2018-2025 GlobalMentor, Inc. (https://www.globalmentor.com/)

## Properties

### Generated Properties
`project.releaseVersion`
: Set to 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`
: Set to the year in which the project was built, in UTC; a string in the format `YYYY`. 
`build.date`
: Set to the date on which the project was built, in UTC; a string in the format `YYYY-MM-DD`.
`build.timestamp`
: Set to the date and time at which the project was built, in UTC; a string in the format `YYYY-MM-DDTHH:MM:SSZ`.
`assemblyDirectory`
: The temporary build directory for assembly descriptors; defaults to `${project.build.directory}/assembly`

### Configurable Properties
`annotationsGeneratedSourcesDirectory`
: The directory for generated source files related to annotation processing; defaults to `${generatedSourcesDirectory}/annotations`.
  If changed will automatically update the Maven Compiler Plugin's setting for generated sources for annotation processing.
`binSourceDirectory`
: The source directory for scripts; defaults to `${project.basedir}/src/bin`.
`binOutputDirectory`
: The output directory for scripts; defaults to `${project.build.directory}/bin`.
`enableCentralPublishing`
: Opt-in flag for publishing to Maven Central; effectively defaults to `false`.
  Set to `true` in child project POMs to enable publishing.
  The root POM itself is automatically opted in to Central Publishing, in which case this flag will be ignored.
`exe.main.class`
: The full class name of the class containing the `main()` method for an executable JAR; no default.
  This property also functions as a flag to create an an executable JAR, create a Linux executable
  script from the executable JAR, generate a Windows executable, and if the `publish` profile is
  in effect produce a "bin" archive with the executable files during the `package` phase.
`exe.base.filename`
: The base filename (e.g. `my-cli`) of any generated executable script or program; defaults to `${project.artifactId}`.
`exe.filename`
: The filename of any generated Windows executable; defaults to `${exe.base.filename}.exe`.
`generatedSourcesDirectory`
: The directory for generated source files; defaults to `${project.build.directory}/generated-sources`.

### Internal Properties
`_exe.main.classAsAbsolutePath`
: If `exe.base.filename` defined, set to the absolute path form of the class; e.g. `com.example.MainClass` becomes `/com/example/MainClass`. 
`_isSkipCentralPublishing`
: Disables publishing to Maven Central by the Central Publishing Maven Plugin.
  Defaults to `false` if the root POM itself is being published.
  Otherwise this gets set to the negation of `${enableCentralPublishing}`.
  Note that this property will not receive its final value until the `validate` phase;
  before then it will have an intermediate value that may not be a Boolean string.
`_isSkipGenerateExe`
: Set to `false` if `${exe.base.filename}` is defined; otherwise set to `true`.
  This property is used to skip exe-related plugin executions.

## Scripts

To copy and process scripts, simply include the scripts in `src/bin` and they will be detected automatically
and the `prepare-bin-files` profile activated. The scripts will be included in any `bin` distributable.

Note that under the current implementaiton, the `bin` distributable will only be created if an `${exe.main.class}`
is specified.
```

The executable JAR will automatically be copied into the same directory in the same phase as a *nix executable script
as long as the `exe.main.class` has been defined.
 -->
<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>3.0.2</version>
	<packaging>pom</packaging>

	<name>GlobalMentor Root</name>
	<description>GlobalMentor root POM.</description>
	<url>https://www.globalmentor.com/software/</url>

	<organization>
		<name>GlobalMentor, Inc.</name>
		<url>https://www.globalmentor.com/</url>
	</organization>

	<developers>
		<developer>
			<name>Garret Wilson</name>
			<email>garret@globalmentor.com</email>
			<organization>GlobalMentor, Inc.</organization>
			<organizationUrl>https://www.globalmentor.com/</organizationUrl>
		</developer>
	</developers>

	<licenses>
		<license>
			<name>Apache-2.0</name>
			<url>https://www.apache.org/licenses/LICENSE-2.0</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<scm>
		<connection>scm:git:https://bitbucket.org/globalmentor/globalmentor-root.git</connection>
		<developerConnection>scm:git:https://bitbucket.org/globalmentor/globalmentor-root.git</developerConnection>
		<url>https://bitbucket.org/globalmentor/globalmentor-root</url>
	</scm>

	<properties>
		<build.finalBaseName>${project.artifactId}</build.finalBaseName>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.release>21</maven.compiler.release>
		<gpg.keyname>software@globalmentor.com</gpg.keyname>
		<!-- versions -->
		<hamcrest.version>3.0</hamcrest.version>
		<junit.version>6.0.1</junit.version>
		<logback.version>1.5.20</logback.version>
		<mockito.version>5.20.0</mockito.version>
		<slf4j.version>2.0.17</slf4j.version>
		<spring.boot.version>3.5.7</spring.boot.version> <!-- used for Spring Boot Maven Plugin; update and use if child project imports Spring Boot BOM -->
		<!-- Maven Central -->
		<enableCentralPublishing>false</enableCentralPublishing> <!-- ignored if publishing the root POM -->
		<!-- files and directories -->
		<assemblyDirectory>${project.build.directory}/assembly</assemblyDirectory>
		<binSourceDirectory>${project.basedir}/src/bin</binSourceDirectory>
		<binOutputDirectory>${project.build.directory}/bin</binOutputDirectory>
		<generatedSourcesDirectory>${project.build.directory}/generated-sources</generatedSourcesDirectory>
		<annotationsGeneratedSourcesDirectory>${generatedSourcesDirectory}/annotations</annotationsGeneratedSourcesDirectory>
		<!--
			Set to generate executable JAR, exe file, and distributables.
			<exe.main.class>com.example.cli.Example</exe.main.class>
		-->
		<exe.base.filename>${project.artifactId}</exe.base.filename>
		<exe.filename>${exe.base.filename}.exe</exe.filename>
		<_xml.cdata.begin>&lt;![CDATA[</_xml.cdata.begin>
		<_xml.cdata.end>]]&gt;</_xml.cdata.end>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.jspecify</groupId>
			<artifactId>jspecify</artifactId>
		</dependency>

		<!-- test scope dependencies -->

		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-engine</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>com.github.npathai</groupId>
			<artifactId>hamcrest-optional</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>org.jspecify</groupId>
				<artifactId>jspecify</artifactId>
				<version>1.0.0</version>
			</dependency>

			<dependency>
				<groupId>org.junit</groupId>
				<artifactId>junit-bom</artifactId>
				<version>${junit.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>

			<dependency>
				<groupId>org.hamcrest</groupId>
				<artifactId>hamcrest</artifactId>
				<version>${hamcrest.version}</version>
			</dependency>

			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-bom</artifactId>
				<version>${slf4j.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>

			<dependency>
				<groupId>ch.qos.logback</groupId>
				<artifactId>logback-access</artifactId>
				<version>${logback.version}</version>
			</dependency>

			<dependency>
				<groupId>ch.qos.logback</groupId>
				<artifactId>logback-classic</artifactId>
				<version>${logback.version}</version>
			</dependency>

			<dependency>
				<groupId>ch.qos.logback</groupId>
				<artifactId>logback-core</artifactId>
				<version>${logback.version}</version>
			</dependency>

			<dependency>
				<groupId>org.mockito</groupId>
				<artifactId>mockito-bom</artifactId>
				<version>${mockito.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>

			<dependency>
				<groupId>org.zalando</groupId>
				<artifactId>faux-pas</artifactId>
				<version>0.9.0</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<finalName>${build.finalBaseName}-${project.version}</finalName>

		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>com.akathist.maven.plugins.launch4j</groupId>
					<artifactId>launch4j-maven-plugin</artifactId>
					<version>2.6.0</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-antrun-plugin</artifactId>
					<version>3.2.0</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-assembly-plugin</artifactId>
					<version>3.7.1</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-clean-plugin</artifactId>
					<version>3.5.0</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.14.1</version>
					<configuration>
						<generatedSourcesDirectory>${annotationsGeneratedSourcesDirectory}</generatedSourcesDirectory>
						<showDeprecation>true</showDeprecation>
						<showWarnings>true</showWarnings>
						<compilerArgs>
							<arg>-Xlint:all</arg>
						</compilerArgs>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-dependency-plugin</artifactId>
					<version>3.9.0</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>3.1.4</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-enforcer-plugin</artifactId>
					<version>3.6.2</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-failsafe-plugin</artifactId>
					<version>3.5.4</version>
					<configuration>
						<!-- Suppress logging and SLF4J internal `INFO` messages when running tests. -->
						<systemPropertyVariables>
							<slf4j.provider>org.slf4j.helpers.NOP_FallbackServiceProvider</slf4j.provider>
							<slf4j.internal.verbosity>WARN</slf4j.internal.verbosity>
						</systemPropertyVariables>
						<!-- Set up [Mockito inline mocking](https://javadoc.io/doc/org.mockito/mockito-core/latest/org.mockito/org/mockito/Mockito.html#0.3). -->
						<argLine>
							-javaagent:${settings.localRepository}/org/mockito/mockito-core/${mockito.version}/mockito-core-${mockito.version}.jar
							-Xshare:off
						</argLine>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>3.2.8</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-help-plugin</artifactId>
					<version>3.5.1</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-install-plugin</artifactId>
					<version>3.1.4</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>3.4.2</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>3.12.0</version>
					<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>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<version>3.1.1</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<version>3.3.1</version>
					<configuration>
						<propertiesEncoding>${project.build.sourceEncoding}</propertiesEncoding>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-site-plugin</artifactId>
					<version>3.21.0</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>3.3.1</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>3.5.4</version>
					<configuration>
						<!-- Suppress logging and SLF4J internal `INFO` messages when running tests. -->
						<systemPropertyVariables>
							<slf4j.provider>org.slf4j.helpers.NOP_FallbackServiceProvider</slf4j.provider>
							<slf4j.internal.verbosity>WARN</slf4j.internal.verbosity>
						</systemPropertyVariables>
						<!-- Set up [Mockito inline mocking](https://javadoc.io/doc/org.mockito/mockito-core/latest/org.mockito/org/mockito/Mockito.html#0.3). -->
						<argLine>
							-javaagent:${settings.localRepository}/org/mockito/mockito-core/${mockito.version}/mockito-core-${mockito.version}.jar
							-Xshare:off
						</argLine>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-war-plugin</artifactId>
					<version>3.5.0</version>
				</plugin>

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>build-helper-maven-plugin</artifactId>
					<version>3.6.1</version>
				</plugin>

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>versions-maven-plugin</artifactId>
					<version>2.19.1</version>
					<configuration>
						<ruleSet>
							<ignoreVersions>
								<ignoreVersion><type>regex</type><version>.*-SNAPSHOT</version></ignoreVersion>
								<ignoreVersion><type>regex</type><version>.*-[aA]\d+</version></ignoreVersion>
								<ignoreVersion><type>regex</type><version>.*[.-][aA]lpha(?:-?\d+)?</version></ignoreVersion>
								<ignoreVersion><type>regex</type><version>.*-[bB]\d+</version></ignoreVersion> <!-- Jakarta EE-->
								<ignoreVersion><type>regex</type><version>.*[.-][bB]eta(?:-?\d+)?</version></ignoreVersion>
								<ignoreVersion><type>regex</type><version>.*-M(?:-?\d+)?</version></ignoreVersion>
								<ignoreVersion><type>regex</type><version>.*\.MR</version></ignoreVersion> <!-- Jakarta EE-->
								<ignoreVersion><type>regex</type><version>.*-(?:rc|RC)(?:-?\d+)?</version></ignoreVersion> <!-- Jackson `…-rc…` -->
								<ignoreVersion><type>regex</type><version>.*-pfd(?:-?\d+)?</version></ignoreVersion> <!-- JCP Proposed Final Draft -->
							</ignoreVersions>
						</ruleSet>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.sonatype.central</groupId>
					<artifactId>central-publishing-maven-plugin</artifactId>
					<version>0.9.0</version>
					<extensions>true</extensions>
					<configuration>
						<publishingServerId>central</publishingServerId>
						<autoPublish>true</autoPublish>
						<waitUntil>validated</waitUntil>
						<skipPublishing>${_isSkipCentralPublishing}</skipPublishing>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.springframework.boot</groupId>
					<artifactId>spring-boot-maven-plugin</artifactId>
					<version>${spring.boot.version}</version>
				</plugin>
			</plugins>
		</pluginManagement>

		<plugins>
			<!-- set up properties -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>

					<!-- `project.releaseVersion` -->
					<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>

					<!-- `build.year` -->
					<execution>
						<id>set-build-year</id>
						<goals>
							<goal>timestamp-property</goal>
						</goals>
						<configuration>
							<locale>en</locale>
							<timeSource>build</timeSource>
							<timeZone>UTC</timeZone>
							<name>build.year</name>
							<pattern>yyyy</pattern>
						</configuration>
					</execution>

					<!-- `build.date` -->
					<execution>
						<id>set-build-date</id>
						<goals>
							<goal>timestamp-property</goal>
						</goals>
						<configuration>
							<locale>en</locale>
							<timeSource>build</timeSource>
							<timeZone>UTC</timeZone>
							<name>build.date</name>
							<pattern>yyyy-MM-dd</pattern>
						</configuration>
					</execution>

					<!-- `build.timestamp` -->
					<execution>
						<id>set-build-timestamp</id>
						<goals>
							<goal>timestamp-property</goal>
						</goals>
						<configuration>
							<locale>en</locale>
							<timeSource>build</timeSource>
							<timeZone>UTC</timeZone>
							<name>build.timestamp</name>
							<pattern>yyyy-MM-dd'T'HH:mm'Z'</pattern>
						</configuration>
					</execution>

					<!--
						`_isSkipCentralPublishing` (Boolean)
						Set to `false` if this is the root POM.
						Otherwise set to the negation of `${enableCentralPublishing}`.

						The first step is to set the property to `false` if this is the root POM.
					-->
					<execution>
						<id>set-is-skip-central-publishing-false-or-prefixed</id>
						<phase>validate</phase>
						<goals>
							<goal>regex-property</goal>
						</goals>
						<configuration>
							<name>_isSkipCentralPublishing</name>
							<value>_${project.groupId}:${project.artifactId}</value>
							<regex>^_com\.globalmentor:globalmentor-root$</regex>
							<replacement>false</replacement>
							<failIfNoMatch>false</failIfNoMatch>
						</configuration>
					</execution>
					<!--
						At this point `${_isSkipCentralPublishing}` will either be `false` if the root POM,
						or `_${project.groupId}:${project.artifactId}` corresponding to the project coordinates.
						Convert that to the `!${enableCentralPublishing}`, which is  the literal string
						of the negation of the Central Publishing opt-in flag.
					-->
					<execution>
						<id>set-is-skip-central-publishing</id>
						<phase>initialize</phase>
						<goals>
							<goal>regex-property</goal>
						</goals>
						<configuration>
							<name>_isSkipCentralPublishing</name>
							<value>${_isSkipCentralPublishing}</value>
							<regex>^_.*$</regex>
							<replacement>!${enableCentralPublishing}</replacement>
							<toLowerCase>true</toLowerCase>
							<failIfNoMatch>false</failIfNoMatch>
						</configuration>
					</execution>
					<!--
						At this point `${_isSkipCentralPublishing}` will either be `false`, `!false` or `!true`.
						Handle both negated cases by replacing with the negated value.
						The two cases are mutually exclusive, so they can be done in the same phase.
						The phase `generate-sources` is an arbitrary phase after `initialize`.
					-->
					<execution>
						<id>set-is-skip-central-publishing-not-false</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>regex-property</goal>
						</goals>
						<configuration>
							<name>_isSkipCentralPublishing</name>
							<value>${_isSkipCentralPublishing}</value>
							<regex>^!false$</regex>
							<replacement>true</replacement>
							<failIfNoMatch>false</failIfNoMatch>
						</configuration>
					</execution>
					<execution>
						<id>set-is-skip-central-publishing-not-true</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>regex-property</goal>
						</goals>
						<configuration>
							<name>_isSkipCentralPublishing</name>
							<value>${_isSkipCentralPublishing}</value>
							<regex>^!true$</regex>
							<replacement>false</replacement>
							<failIfNoMatch>false</failIfNoMatch>
						</configuration>
					</execution>

					<!--
						`_isSkipGenerateExe` (Boolean)
						Set equivalent to "not defined `${exe.main.class}`".
					-->
					<execution>
						<id>set-is-skip-generate-exe-true-or-prefixed</id>
						<phase>validate</phase>
						<goals>
							<goal>regex-property</goal>
						</goals>
						<configuration>
							<name>_isSkipGenerateExe</name>
							<value>_${exe.main.class}</value>
							<regex>^_\$\{exe\.main\.class\}$</regex>
							<replacement>true</replacement>
							<failIfNoMatch>false</failIfNoMatch>
						</configuration>
					</execution>
					<execution>
						<id>set-is-skip-generate-exe</id>
						<phase>initialize</phase>
						<goals>
							<goal>regex-property</goal>
						</goals>
						<configuration>
							<name>_isSkipGenerateExe</name>
							<value>${_isSkipGenerateExe}</value>
							<regex>^_.*$</regex>
							<replacement>false</replacement>
							<failIfNoMatch>false</failIfNoMatch>
						</configuration>
					</execution>

					<!--
						`_exe.main.classAsAbsolutePath`
						Set to absolute path version of `exe.main.class`,
						e.g. `/com/example/MainClass` for `com.example.MainClass`.
						If `${exe.main.class}` is undefined, the value will be invalid and should be ignored. 
					-->
					<execution>
						<id>set-exe-main-class-as-path</id>
						<goals>
							<goal>regex-property</goal>
						</goals>
						<configuration>
							<name>_exe.main.classAsAbsolutePath</name>
							<value>/${exe.main.class}</value>
							<regex>\.</regex>
							<replacement>/</replacement>
							<failIfNoMatch>false</failIfNoMatch>
						</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.6.3</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.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>versions-maven-plugin</artifactId>
			</plugin>

			<plugin>
				<groupId>org.sonatype.central</groupId>
				<artifactId>central-publishing-maven-plugin</artifactId>
			</plugin>

			<!-- Generate program executable and related distributables if `${exe.main.class}` is set. -->
			<!-- phase: package -->
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<executions>
					<execution>
						<!--
							Generates a repackaged nested executable JAR in `${buildDirectory}`.
							This execution is only enabled if `${exe.main.class}` is defined.
						-->
						<id>generate-exe-jar</id>
						<phase>package</phase>
						<goals>
							<goal>repackage</goal>
						</goals>
						<configuration>
							<skip>${_isSkipGenerateExe}</skip>
							<layout>JAR</layout>
							<classifier>exe</classifier>
							<mainClass>${exe.main.class}</mainClass>
							<executable>true</executable>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>com.akathist.maven.plugins.launch4j</groupId>
				<artifactId>launch4j-maven-plugin</artifactId>
				<executions>
					<execution>
						<!--
							Generates a Windows `.exe` file from the `-exe.jar` in `${buildDirectory}`.
							This execution is only enabled if `${exe.main.class}` is defined.
							Depends on the output of the `spring-boot-maven-plugin` `generate-exe-jar` execution.  
						 -->
						<id>generate-exe</id>
						<phase>package</phase>
						<goals>
							<goal>launch4j</goal>
						</goals>
						<configuration>
							<skip>${_isSkipGenerateExe}</skip>
							<headerType>console</headerType>
							<outfile>${binOutputDirectory}/${exe.filename}</outfile>
							<jar>${project.build.directory}/${project.artifactId}-${project.version}-exe.jar</jar>
							<errTitle>${project.name}</errTitle>
							<downloadUrl>https://adoptium.net/</downloadUrl>
							<jre>
								<path>%JAVA_HOME%;%PATH%</path>
								<minVersion>${maven.compiler.release}</minVersion>
								<opts>
									<!-- Allow native access for Jansi. -->
									<!-- Allowance will be narrowed in JAVA-385 when Jansi supports modules. -->
									<opt>--enable-native-access=ALL-UNNAMED</opt>
								</opts>
							</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-antrun-plugin</artifactId>
				<executions>
					<!-- phase: generate-resources -->
					<execution>
						<!--
							Generates a build properties file for `${exe.main.class}`, e.g. for `com.example.MainClass`
							in the form `target/classes/com/example/MainClass-build.properties.xml`.
						-->
						<id>generate-build-properties</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<skip>${_isSkipGenerateExe}</skip>
							<target>
								<echo file="${project.build.outputDirectory}${_exe.main.classAsAbsolutePath}-build.properties.xml" encoding="UTF-8">
									<![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
	<comment>Generated build information.</comment>
	<entry key="name">${_xml.cdata.begin}${project.name}${_xml.cdata.end}</entry>
	<entry key="version">${_xml.cdata.begin}${project.version}${_xml.cdata.end}</entry>
	<entry key="builtAt">${_xml.cdata.begin}${build.timestamp}${_xml.cdata.end}</entry>
</properties>]]>
								</echo>
							</target>
						</configuration>
					</execution>
					<!-- phase: package -->
					<execution>
						<!--
							Copies the executable JAR to `${binOutputDirectory}` as a *nix script and makes it executable.
							This execution is only enabled if `${exe.main.class}` is defined.
							Depends on the output of the `spring-boot-maven-plugin` `generate-exe-jar` execution.
						 -->
						<id>copy-exe-jar-as-script</id>
						<phase>package</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<skip>${_isSkipGenerateExe}</skip>
							<target>
								<copy file="${project.build.directory}/${project.artifactId}-${project.version}-exe.jar" tofile="${binOutputDirectory}/${exe.base.filename}" />
								<chmod file="${binOutputDirectory}/${exe.base.filename}" perm="+x" />
							</target>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<!-- Provides additional atifacts and signs all artifacts for publishing. -->
			<id>publish</id>
			<build>
				<plugins>
					<!-- phase: prepare-package -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<executions>
							<execution>
								<!--
									Generates an assembly descriptor for the binary distribution.
								-->
								<id>generate-bin-assembly-descriptor</id>
								<phase>prepare-package</phase>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<skip>${_isSkipGenerateExe}</skip>
									<target>
										<echo file="${assemblyDirectory}/bin.xml" encoding="UTF-8">
											<![CDATA[<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
	<id>bin</id>
	<formats>
		<format>tar.xz</format>
		<format>zip</format>
	</formats>
	<fileSets>
		<fileSet>
			<directory>${project.build.directory}</directory>
			<includes>
				<include>*-exe.jar</include>
			</includes>
			<outputDirectory>bin</outputDirectory>
		</fileSet>
		<fileSet>
			<directory>${binOutputDirectory}</directory>
			<outputDirectory>bin</outputDirectory>
			<!--
				Set access permissions to `-rwxrwxr-x`, which corresponds to adding `+x` to a created file.
				Manually setting permissions files in the archive is necessary for building on Windows,
				because input files will have lost attributes during the build process.
			-->
			<fileMode>0775</fileMode>
		</fileSet>
	</fileSets>
</assembly>]]>
										</echo>
									</target>
								</configuration>
							</execution>
						</executions>
					</plugin>

					<!-- phase: package -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-assembly-plugin</artifactId>
						<executions>
							<execution>
								<!--
									Assembles the binary distribution.
									Depends on the output of the `generate-bin-assembly-descriptor` execution.
									Implementation Note: It is unclear if it is guaranteed that profile plugins
									are executed after main build plugins at the same level. If there are problems
									in the future because of Antrun tasks in the main build in the `package` phase,
									this task can be moved to the `post-integration-test` phase.
									See [MNG-4975](https://issues.apache.org/jira/browse/MNG-4975).
									See [MNG-5987](https://issues.apache.org/jira/browse/MNG-5987). 
								-->
								<id>assemble-bin-dist</id>
								<phase>package</phase>
								<goals>
									<goal>single</goal>
								</goals>
								<configuration>
									<skipAssembly>${_isSkipGenerateExe}</skipAssembly>
									<descriptors>
										<descriptor>${assemblyDirectory}/bin.xml</descriptor>
									</descriptors>
								</configuration>
							</execution>
						</executions>
					</plugin>

					<!-- phase: verify -->
					<plugin>
						<!-- Requires [GnuPG](https://www.gnupg.org/download/) to be installed. -->
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<executions>
							<execution>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<!-- Performs a "quick" build without running tests and checks. -->
			<id>quick</id>
			<properties>
				<maven.javadoc.skip>true</maven.javadoc.skip> <!-- Javadoc -->
				<skipTests>true</skipTests> <!-- Surefire -->
				<skipITs>true</skipITs> <!-- Failsafe -->
			</properties>
		</profile>

		<profile>
			<!-- Copies binary files to `target/bin` if there is a `src/bin` directory. -->
			<id>prepare-bin-files</id>

			<activation>
				<file>
					<exists>${binSourceDirectory}</exists>
				</file>
			</activation>

			<build>
				<plugins>
					<!-- phase: generate-resources -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-resources-plugin</artifactId>
						<executions>
							<execution>
								<!--
									Copies scripts from `${binSourceDirectory}` to `${binOutputDirectory}`.
									This is only necessary if special binary files from the source tree should be included.,
									such as `.bat` or `.sh` scripts.
									Startup shell scripts have largely been replaced by a using the executable JAR as a *unix script
									(see `copy-exe-jar-as-script`) and by generating an executable for Windows (see `generate-exe`).  
									Uses `~{}` delimiters, because `${}` clashes with script variable replacement.
								 -->
								<id>copy-bin</id>
								<phase>generate-resources</phase>
								<goals>
									<goal>resources</goal>
								</goals>
								<configuration>
									<resources>
										<resource>
											<directory>${binSourceDirectory}</directory>
											<includes>
												<include>**/*.bat</include>
												<include>**/*.sh</include>
											</includes>
											<filtering>true</filtering>
										</resource>
									</resources>
									<useDefaultDelimiters>false</useDefaultDelimiters>
									<delimiters>
										<delimiter>~{*}</delimiter>
									</delimiters>
									<outputDirectory>${binOutputDirectory}</outputDirectory>
								</configuration>
							</execution>
						</executions>
					</plugin>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<executions>
							<execution>
								<!--
									Create the `${binOutputDirectory}` directory for use by later tasks.
								 -->
								<id>create-bin-output-dir</id>
								<phase>initialize</phase>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<target>
										<mkdir dir="${binOutputDirectory}" />
									</target>
								</configuration>
							</execution>
							<execution>
								<!--
									Enable execute permission for the shell scripts in `${binOutputDirectory}`.
									Remove the `.sh` extension from shell scripts in `${binOutputDirectory}`.
								 -->
								<id>process-shell-scripts</id>
								<phase>process-resources</phase>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<target>
										<chmod dir="${binOutputDirectory}" includes="**/*.sh" perm="+x" />
										<move todir="${binOutputDirectory}">
											<fileset dir="${binOutputDirectory}" includes="**/*.sh" />
											<mapper type="glob" from="*.sh" to="*" />
										</move>
									</target>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
