<!--
  ~ Copyright 2012-2023 Oscar Westra van Holthe - Kind
  ~
  ~ 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/maven-v4_0_0.xsd"
         child.project.url.inherit.append.path="false">
	<modelVersion>4.0.0</modelVersion>

	<groupId>net.sf.opk</groupId>
	<artifactId>opk-parent</artifactId>
	<version>15</version>
	<packaging>pom</packaging>

	<name>${project.artifactId}</name>
	<description>${project.groupId}:${project.artifactId}</description>
	<url>${project.organization.url}${project.artifactId}/</url>
	<inceptionYear>2011</inceptionYear>
	<scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false"
	     child.scm.url.inherit.append.path="false">
		<url>https://github.com/opwvhk/${project.artifactId}</url>
		<developerConnection>scm:git:git@github.com:opwvhk/${project.artifactId}.git</developerConnection>
		<tag>HEAD</tag>
	</scm>
	<licenses>
		<license>
			<name>Apache-2.0</name>
			<url>https://opensource.org/license/apache-2-0/</url>
			<distribution>repo</distribution>
		</license>
	</licenses>
	<developers>
		<developer>
			<name>Oscar Westra van Holthe - Kind</name>
		</developer>
	</developers>
	<organization>
		<!-- Not really an organization, but the owner of the copyrights. -->
		<name>Oscar Westra van Holthe - Kind</name>
		<url>https://github.com/opwvhk/</url>
	</organization>
	<properties>
		<!-- Build configurations -->
		<maven.compiler.release>21</maven.compiler.release>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>${project.build.sourceEncoding}</project.reporting.outputEncoding>
		<!-- Plugin versions -->
		<maven-enforcer-plugin.version>3.6.2</maven-enforcer-plugin.version>
		<maven-resources-plugin.version>3.4.0</maven-resources-plugin.version>
		<maven-compiler-plugin.version>3.15.0</maven-compiler-plugin.version>
		<maven-source-plugin.version>3.4.0</maven-source-plugin.version>
		<maven-surefire-plugin.version>3.5.5</maven-surefire-plugin.version>
		<maven-failsafe-plugin.version>3.5.5</maven-failsafe-plugin.version>
		<maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>
		<maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
		<maven-install-plugin.version>3.1.4</maven-install-plugin.version>
		<maven-release-plugin.version>3.3.1</maven-release-plugin.version>
		<!-- Settings to publish to Maven Central -->
		<central-publishing-maven-plugin.version>0.10.0</central-publishing-maven-plugin.version>
		<publishingServerId>maven-central-portal</publishingServerId>
		<deploymentName>${project.groupId}:${project.artifactId}:${project.version}</deploymentName>
		<autoPublish>true</autoPublish>
		<waitUntil>validated</waitUntil>
	</properties>
	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-enforcer-plugin</artifactId>
					<version>${maven-enforcer-plugin.version}</version>
					<executions>
						<execution>
							<id>enforce-sonatype-oss-requirements</id>
							<goals>
								<goal>enforce</goal>
							</goals>
							<configuration>
								<rules>
									<requireMavenVersion>
										<version>[3.5.4,)</version>
										<message>You need a Maven version at most 5 years old</message>
									</requireMavenVersion>
									<requireJavaVersion>
										<version>11</version>
									</requireJavaVersion>
									<requireReleaseDeps>
										<message>Release versions do not allow snapshot dependencies; they must re
											reproducible.
										</message>
										<onlyWhenRelease>true</onlyWhenRelease>
									</requireReleaseDeps>
									<requireUpperBoundDeps/>
									<requireFilesExist>
										<message>An OSS project requires a license</message>
										<satisfyAny>true</satisfyAny>
										<files>
											<file>LICENSE</file>
											<file>LICENSE.md</file>
											<file>LICENSE.txt</file>
										</files>
									</requireFilesExist>
									<requireProperty>
										<property>project.groupId</property>
									</requireProperty>
									<requireProperty>
										<property>project.artifactId</property>
									</requireProperty>
									<requireProperty>
										<property>project.version</property>
									</requireProperty>
									<requireProperty>
										<property>project.name</property>
									</requireProperty>
									<requireProperty>
										<property>project.description</property>
									</requireProperty>
									<requireProperty>
										<property>project.url</property>
									</requireProperty>
									<requireProperty>
										<property>project.organization.name</property>
									</requireProperty>
									<requireProperty>
										<property>project.inceptionYear</property>
									</requireProperty>
									<requireProperty>
										<property>project.licenses[0].name</property>
									</requireProperty>
									<requireProperty>
										<property>project.licenses[0].url</property>
									</requireProperty>
									<requireProperty>
										<property>project.scm.developerConnection</property>
									</requireProperty>
								</rules>
								<fail>true</fail>
							</configuration>
						</execution>
						<execution>
							<id>allow-deploy-only-for-release-versions</id>
							<phase>deploy</phase>
							<goals>
								<goal>enforce</goal>
							</goals>
							<configuration>
								<rules combine.self="override">
									<requireReleaseVersion>
										<message>Creating a release requires a release version (not a snapshot).
										</message>
									</requireReleaseVersion>
								</rules>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>flatten-maven-plugin</artifactId>
					<version>1.7.3</version>
					<executions>
						<execution>
							<id>flatten</id>
							<phase>process-resources</phase>
							<goals>
								<goal>flatten</goal>
							</goals>
							<configuration>
								<defaultOperation>extended_interpolate</defaultOperation>
								<flattenMode>oss</flattenMode>
								<keepCommentsInPom>true</keepCommentsInPom>
							</configuration>
						</execution>
						<execution>
							<id>flatten.clean</id>
							<phase>clean</phase>
							<goals>
								<goal>clean</goal>
							</goals>
						</execution>
					</executions>
				</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-compiler-plugin</artifactId>
					<version>${maven-compiler-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>${maven-surefire-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-failsafe-plugin</artifactId>
					<version>${maven-failsafe-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>${maven-source-plugin.version}</version>
					<executions>
						<execution>
							<id>oss-requires-sources</id>
							<goals>
								<goal>jar-no-fork</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>${maven-javadoc-plugin.version}</version>
					<executions>
						<execution>
							<id>oss-requires-javadocs</id>
							<goals>
								<goal>jar</goal>
							</goals>
						</execution>
					</executions>
					<configuration combine.children="append">
						<doclint>all,-missing</doclint>
					</configuration>
				</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>install</phase>
							<goals>
								<goal>sign</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-install-plugin</artifactId>
					<version>${maven-install-plugin.version}</version>
					<executions>
						<!--
						To ensure the gpg plugin runs first, we delete the default execution (which always executes
						first), and recreate it. Because we do this _below_ the gpg plugin, this ensures the new
						execution runs after the gpg plugin execution.

						Can be verified using: mvn org.codehaus.mojo:buildplan-maven-plugin:list
						-->
						<execution>
							<id>default-install</id>
							<phase>none</phase>
						</execution>
						<execution>
							<id>signed-install</id>
							<goals>
								<goal>install</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.sonatype.central</groupId>
					<artifactId>central-publishing-maven-plugin</artifactId>
					<version>${central-publishing-maven-plugin.version}</version>
					<extensions>true</extensions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<version>${maven-release-plugin.version}</version>
					<configuration>
						<scmDevelopmentCommitComment>Next development version</scmDevelopmentCommitComment>
						<scmReleaseCommitComment>Release @{releaseLabel}</scmReleaseCommitComment>
						<pushChanges>true</pushChanges>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>flatten-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-gpg-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-install-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.sonatype.central</groupId>
				<artifactId>central-publishing-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>
</project>
