<?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>

	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.4.3</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>

	<groupId>ch.mobi.mobitor</groupId>
	<artifactId>mobitor-parent</artifactId>
	<version>3.1.295</version>
	<packaging>pom</packaging>

	<name>mobitor-parent</name>
	<description>Show deployment status along with other information from sources like TeamCity, Jira, Sonar on a screen per team.</description>
	<url>https://bitbucket.org/mobiliar/mobitor-parent</url>

	<inceptionYear>2019</inceptionYear>

	<licenses>
		<license>
			<name>GNU LESSER GENERAL PUBLIC LICENSE</name>
			<url>http://www.gnu.org/licenses/lgpl.txt</url>
		</license>
	</licenses>

	<organization>
		<name>Die Mobiliar</name>
		<url>https://www.mobiliar.ch/</url>
	</organization>

	<properties>
		<java.version>11</java.version>

		<asciidoctor.maven.plugin.version>1.5.6</asciidoctor.maven.plugin.version>
		<asciidoctorj.version>1.5.6</asciidoctorj.version>
		<jruby.version>1.7.26</jruby.version>

		<jacoco.append>true</jacoco.append>
		<jacoco.it.destFile>${project.build.directory}/jacoco-it.exec</jacoco.it.destFile>
		<jacoco.destFile>${project.build.directory}/jacoco.exec</jacoco.destFile>
		<sonar.jacoco.reportPaths>${jacoco.destFile},${jacoco.it.destFile}</sonar.jacoco.reportPaths>

		<license.licenseName>lgpl_v3</license.licenseName>
	</properties>

	<modules>
		<module>mobitor-plugins-test</module>
		<module>mobitor-plugins-api</module>
		<module>mobitor-plugins-parent</module>
		<module>mobitor-base</module>
    </modules>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>ch.mobi.mobitor</groupId>
				<artifactId>mobitor-plugins-api</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>ch.mobi.mobitor</groupId>
				<artifactId>mobitor-plugins-test</artifactId>
				<version>${project.version}</version>
			</dependency>
			<dependency>
				<groupId>ch.mobi.mobitor</groupId>
				<artifactId>mobitor-base</artifactId>
				<version>${project.version}</version>
			</dependency>

			<dependency>
				<groupId>org.apache.commons</groupId>
				<artifactId>commons-collections4</artifactId>
				<version>4.4</version>
			</dependency>

			<dependency>
				<groupId>org.jetbrains</groupId>
				<artifactId>annotations</artifactId>
				<version>19.0.0</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</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>license-maven-plugin</artifactId>
				<version>2.0.0</version>
				<configuration>
					<verbose>false</verbose>
					<includes>
						<include>**/*.java</include>
					</includes>
					<ignoreNoFileToScan>true</ignoreNoFileToScan>
				</configuration>
				<executions>
					<execution>
						<id>file-header</id>
						<goals>
							<goal>update-file-header</goal>
						</goals>
						<phase>process-sources</phase>
						<configuration>
							<processStartTag>§</processStartTag>
							<sectionDelimiter>--</sectionDelimiter>
							<processEndTag>§§</processEndTag>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>coverage</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
						<version>0.8.3</version>
						<configuration>
							<append>true</append>
							<includes>
								<include>ch.mobi.mobitor.*</include>
							</includes>
						</configuration>
						<executions>
							<execution>
								<id>prepare-agent-for-ut</id>
								<goals>
									<goal>prepare-agent</goal>
								</goals>
								<configuration>
									<destFile>${jacoco.destFile}</destFile>
								</configuration>
							</execution>
							<execution>
								<id>prepare-agent-for-it</id>
								<goals>
									<goal>prepare-agent-integration</goal>
								</goals>
								<configuration>
									<destFile>${jacoco.it.destFile}</destFile>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>release</id>
			<properties>
				<gpg.keyname>${env.GPG_KEY}</gpg.keyname>
				<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
			</properties>
			<build>
				<plugins>

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

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

	<scm>
		<connection>scm:git:https://bitbucket.org/mobiliar/mobitor-parent.git</connection>
		<url>https://bitbucket.org/mobiliar/mobitor-parent.git</url>
	</scm>
</project>
