<?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>
	<groupId>name.bychkov</groupId>
	<artifactId>junit5-fakesmtp</artifactId>
	<version>1.0.1</version>

	<name>JUnit5-Extension FakeSMTP</name>
	<description>FakeSMTP for unit-testing smtp clients with JUnit 5</description>
	<url>https://bvfalcon.github.io/junit5-fakesmtp/</url>

	<scm>
		<url>https://github.com/bvfalcon/junit5-fakesmtp</url>
		<connection>scm:git:git@github.com:bvfalcon/junit5-fakesmtp.git</connection>
		<developerConnection>scm:git:git@github.com:bvfalcon/junit5-fakesmtp.git</developerConnection>
	</scm>

	<issueManagement>
		<system>GitHub</system>
		<url>https://github.com/bvfalcon/junit5-fakesmtp/issues</url>
	</issueManagement>

	<licenses>
		<license>
			<name>The Apache License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
		</license>
	</licenses>

	<developers>
		<developer>
			<id>bvfalcon</id>
			<name>Vladimir V. Bychkov</name>
			<email>github@bychkov.name</email>
			<url>https://github.com/bvfalcon</url>
			<roles>
				<role>Developer</role>
			</roles>
		</developer>
	</developers>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>

		<maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
		<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
		<maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
		<maven-resources-plugin.version>3.3.0</maven-resources-plugin.version>
		<maven-enforcer-plugin.version>3.1.0</maven-enforcer-plugin.version>
		<maven-javadoc-plugin.version>3.4.0</maven-javadoc-plugin.version>
		<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
		<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
		<maven-assembly-plugin.version>3.4.1</maven-assembly-plugin.version>
		<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
		<maven-install-plugin.version>3.1.0</maven-install-plugin.version>
		<build-helper-maven-plugin.version>3.3.0</build-helper-maven-plugin.version>
		<maven-invoker-plugin.version>3.3.0</maven-invoker-plugin.version>
		<maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>

		<nexus.host>s01.oss.sonatype.org</nexus.host>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-api</artifactId>
			<version>5.9.2</version>
			<scope>provided</scope>
		</dependency>
	</dependencies>

	<repositories>
		<repository>
			<id>jitpack.io</id>
			<url>https://jitpack.io</url>
		</repository>
	</repositories>

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-clean-plugin</artifactId>
				<version>${maven-clean-plugin.version}</version>
			</plugin>
			<plugin>
				<artifactId>maven-jar-plugin</artifactId>
				<version>${maven-jar-plugin.version}</version>
			</plugin>
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<version>${maven-resources-plugin.version}</version>
			</plugin>
			<plugin>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>${maven-surefire-plugin.version}</version>
			</plugin>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>${maven-compiler-plugin.version}</version>
			</plugin>
			<plugin>
				<artifactId>maven-invoker-plugin</artifactId>
				<version>${maven-invoker-plugin.version}</version>
				<configuration>
					<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
					<showErrors>true</showErrors>
					<streamLogs>false</streamLogs>
					<debug>true</debug>
					<settingsFile>src/it/settings.xml</settingsFile>
					<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
					<mavenOpts>-Djava.io.tmpdir=${project.build.directory}/it</mavenOpts>
					<properties>
						<maven.compiler.source>${maven.compiler.source}</maven.compiler.source>
						<maven.compiler.target>${maven.compiler.target}</maven.compiler.target>
					</properties>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>jakarta.mail</id>
			<dependencies>
				<dependency>
					<groupId>com.github.bvfalcon</groupId>
					<artifactId>subethasmtp</artifactId>
					<version>6.0.5-jul</version>
					<exclusions>
						<exclusion>
							<groupId>com.sun.mail</groupId>
							<artifactId>jakarta.mail</artifactId>
						</exclusion>
					</exclusions>
				</dependency>
				<dependency>
					<groupId>com.sun.mail</groupId>
					<artifactId>jakarta.mail</artifactId>
					<version>2.0.1</version>
					<scope>provided</scope>
				</dependency>
			</dependencies>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>build-helper-maven-plugin</artifactId>
						<version>${build-helper-maven-plugin.version}</version>
						<executions>
							<execution>
								<id>add-jakarta.mail-source</id>
								<phase>generate-sources</phase>
								<goals>
									<goal>add-source</goal>
								</goals>
								<configuration>
									<sources>
										<source>src/jakarta.mail/java</source>
									</sources>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-assembly-plugin</artifactId>
						<version>${maven-assembly-plugin.version}</version>
						<configuration>
							<appendAssemblyId>false</appendAssemblyId>
							<descriptorRefs>
								<descriptorRef>jar-with-dependencies</descriptorRef>
							</descriptorRefs>
						</configuration>
						<executions>
							<execution>
								<id>make-assembly</id>
								<phase>package</phase>
								<goals>
									<goal>single</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-install-plugin</artifactId>
						<version>${maven-install-plugin.version}</version>
						<configuration>
							<groupId>${project.groupId}</groupId>
							<artifactId>${project.artifactId}</artifactId>
							<version>${project.version}</version>
							<packaging>jar</packaging>
							<pomFile>pom.xml</pomFile>
						</configuration>
						<executions>
							<execution>
								<id>default-install</id>
								<configuration>
									<skip>true</skip>
								</configuration>
							</execution>
							<execution>
								<id>install-jakarta-classifier</id>
								<phase>install</phase>
								<goals>
									<goal>install-file</goal>
								</goals>
								<configuration>
									<classifier>jakarta</classifier>
									<file>${project.build.directory}/${project.build.finalName}.jar</file>
								</configuration>
							</execution>
							<execution>
								<id>install-jakarta-sources-classifier</id>
								<phase>install</phase>
								<goals>
									<goal>install-file</goal>
								</goals>
								<configuration>
									<classifier>jakarta-sources</classifier>
									<file>${project.build.directory}/${project.build.finalName}-sources.jar</file>
								</configuration>
							</execution>
							<execution>
								<id>install-jakarta-javadoc-classifier</id>
								<phase>install</phase>
								<goals>
									<goal>install-file</goal>
								</goals>
								<configuration>
									<classifier>jakarta-javadoc</classifier>
									<file>${project.build.directory}/${project.build.finalName}-javadoc.jar</file>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>${maven-gpg-plugin.version}</version>
						<executions>
							<execution>
								<id>deploy-jakarta-classifier</id>
								<phase>deploy</phase>
								<goals>
									<goal>sign-and-deploy-file</goal>
								</goals>
								<configuration>
									<groupId>${project.groupId}</groupId>
									<artifactId>${project.artifactId}</artifactId>
									<version>${project.version}</version>
									<packaging>jar</packaging>
									<repositoryId>ossrh</repositoryId>
									<url>https://${nexus.host}/content/repositories/releases</url>
									<generatePom>false</generatePom>
									<classifiers>jakarta,jakarta-sources,jakarta-javadoc</classifiers>
									<files>${project.build.directory}/${project.build.finalName}.jar,${project.build.directory}/${project.build.finalName}-sources.jar,${project.build.directory}/${project.build.finalName}-javadoc.jar</files>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-invoker-plugin</artifactId>
						<executions>
							<execution>
								<id>check-jakartamail-example</id>
								<phase>install</phase>
								<goals>
									<goal>install</goal>
									<goal>run</goal>
								</goals>
								<configuration>
									<invokerTest>*jakarta*</invokerTest>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>java.mail</id>
			<dependencies>
				<dependency>
					<groupId>com.github.bvfalcon</groupId>
					<artifactId>subethasmtp</artifactId>
					<version>5.2.8-jul</version>
					<exclusions>
						<exclusion>
							<groupId>com.sun.mail</groupId>
							<artifactId>jakarta.mail</artifactId>
						</exclusion>
					</exclusions>
				</dependency>
				<dependency>
					<groupId>com.sun.mail</groupId>
					<artifactId>jakarta.mail</artifactId>
					<version>1.6.5</version>
					<scope>provided</scope>
				</dependency>
			</dependencies>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>build-helper-maven-plugin</artifactId>
						<version>${build-helper-maven-plugin.version}</version>
						<executions>
							<execution>
								<id>add-java.mail-source</id>
								<phase>generate-sources</phase>
								<goals>
									<goal>add-source</goal>
								</goals>
								<configuration>
									<sources>
										<source>src/java.mail/java</source>
									</sources>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-assembly-plugin</artifactId>
						<version>${maven-assembly-plugin.version}</version>
						<configuration>
							<appendAssemblyId>false</appendAssemblyId>
							<descriptorRefs>
								<descriptorRef>jar-with-dependencies</descriptorRef>
							</descriptorRefs>
						</configuration>
						<executions>
							<execution>
								<id>make-assembly</id>
								<phase>package</phase>
								<goals>
									<goal>single</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-invoker-plugin</artifactId>
						<executions>
							<execution>
								<id>check-javamail-example</id>
								<goals>
									<goal>install</goal>
									<goal>run</goal>
								</goals>
								<configuration>
									<invokerTest>*java*</invokerTest>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<!-- artifact publication to Maven Central -->
		<profile>
			<id>publish</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
			<properties>
				<gpg.executable>gpg</gpg.executable>
			</properties>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-enforcer-plugin</artifactId>
						<version>${maven-enforcer-plugin.version}</version>
						<executions>
							<execution>
								<id>enforce-java-1.8</id>
								<goals>
									<goal>enforce</goal>
								</goals>
								<configuration>
									<rules>
										<requireJavaVersion>
											<version>[1.8,1.9)</version>
										</requireJavaVersion>
									</rules>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-source-plugin</artifactId>
						<version>${maven-source-plugin.version}</version>
						<executions>
							<execution>
								<id>attach-sources</id>
								<phase>verify</phase>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>${maven-javadoc-plugin.version}</version>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<phase>verify</phase>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<doclint>none</doclint>
						</configuration>
					</plugin>
					<plugin>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>${maven-gpg-plugin.version}</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>${nexus-staging-maven-plugin.version}</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://${nexus.host}/</nexusUrl>
							<autoReleaseAfterClose>true</autoReleaseAfterClose>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
