<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>io.slugstack.oss</groupId>
	<artifactId>rewrite-definitions</artifactId>
	<version>0.0.3</version>
	<name>rewrite-definitions</name>

	<description>an example of releasing a java project using github actions</description>

	<url>https://github.com/slugstack/rewrite-definitions</url>

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

	<developers>
		<developer>
			<name>Aaron Gershman</name>
			<url>https://github.com/aegershman</url>
			<id>aegershman</id>
		</developer>
	</developers>

	<organization>
		<name>slugstack.io</name>
		<url>https://slugstack.io</url>
	</organization>

	<scm>
		<connection>scm:git:https://github.com:slugstack/rewrite-definitions.git</connection>
		<developerConnection>${developerConnectionUrl}</developerConnection>
		<url>scm:git:https://github.com/slugstack/rewrite-definitions.git</url>
		<!-- <tag>0.0.1-SNAPSHOT</tag> -->
		<tag>rewrite-definitions-0.0.3</tag>
	</scm>

	<properties>
		<developerConnectionUrl>scm:git:ssh://git@github.com/slugstack/rewrite-definitions.git</developerConnectionUrl>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<java.version>11</java.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
			<version>1.18.16</version>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter</artifactId>
			<version>5.7.0</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>3.0.0-M1</version>
				<configuration>
					<releaseProfiles>release</releaseProfiles>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.1</version>
				<configuration>
					<source>${java.version}</source>
					<target>${java.version}</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>3.0.0-M5</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-invoker-plugin</artifactId>
				<version>3.2.1</version>
				<configuration>
					<postBuildHookScript>verify</postBuildHookScript>
					<showVersion>true</showVersion>
					<streamLogs>true</streamLogs>
					<noLog>false</noLog>
					<showErrors>true</showErrors>
				</configuration>
				<executions>
					<execution>
						<id>integration-test</id>
						<goals>
							<goal>install</goal>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

		</plugins>
	</build>


	<profiles>
		<profile>
			<id>release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>3.2.0</version>
						<executions>
							<execution>
								<phase>compile</phase>
								<goals>
									<goal>javadoc</goal>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<version>3.2.1</version>
						<executions>
							<execution>
								<phase>compile</phase>
								<goals>
									<goal>aggregate</goal>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>1.6</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
								<configuration>
									<!-- Prevent gpg from using pinentry programs. Fixes: gpg: signing failed: Inappropriate ioctl for device -->
									<gpgArguments>
										<arg>--pinentry-mode</arg>
										<arg>loopback</arg>
									</gpgArguments>
								</configuration>
							</execution>
						</executions>
					</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>
				</plugins>
			</build>
		</profile>
		<profile>
			<!-- generally should be stacked after the 'release' profile, but in some cases we may want to discern between a ci-cd system performing the release; and if the situation requires it, a human performing the release -->
			<id>release-automation</id>
			<properties>
				<!-- automation via the maven-release-plugin uses a GITHUB_TOKEN which requires 'https' urls for git pushing -->
				<developerConnectionUrl>scm:git:https://github.com/slugstack/rewrite-definitions.git</developerConnectionUrl>
			</properties>
		</profile>
	</profiles>

	<repositories>
		<repository>
			<id>jcenter</id>
			<name>JCenter</name>
			<url>https://jcenter.bintray.com/</url>
		</repository>
	</repositories>

	<pluginRepositories>
		<pluginRepository>
			<id>jcenter</id>
			<name>JCenter</name>
			<url>https://jcenter.bintray.com/</url>
		</pluginRepository>
	</pluginRepositories>

	<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>
</project>
