<?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>eu.eureka-bpo.log4j2</groupId>
	<artifactId>gmail-appender</artifactId>
	<version>1.0.0</version>
	<packaging>jar</packaging>

	<name>GMail Log4j2 Appender</name>
	<description>GMail Log4j2 Appender</description>
	<url>https://github.com/eureka-bpo/gmail-log4j2-appender.git</url>

	<scm>
		<url>https://github.com/eureka-bpo/gmail-log4j2-appender.git</url>
		<connection>scm:git:https://github.com/eureka-bpo/gmail-log4j2-appender.git</connection>
		<developerConnection>scm:git:git@github.com:eureka-bpo/gmail-log4j2-appender.git</developerConnection>
	</scm>

	<issueManagement>
		<system>GitHub</system>
		<url>https://github.com/eureka-bpo/gmail-log4j2-appender/issues</url>
	</issueManagement>

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

	<developers>
		<developer>
			<email>support@eureka-bpo.eu</email>
			<roles>
				<role>Developer</role>
			</roles>
		</developer>
	</developers>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.report.sourceEncoding>UTF-8</project.report.sourceEncoding>
		<shade.package>eu.eurekabpo.log4j2.shaded</shade.package>
		<gpg.executable>gpg</gpg.executable>
		<nexus.host>s01.oss.sonatype.org</nexus.host>
		
		<maven.compiler.source>11</maven.compiler.source>
		<maven.compiler.target>11</maven.compiler.target>
		<compiler-plugin.version>3.13.0</compiler-plugin.version>
		<surefire-plugin.version>3.2.5</surefire-plugin.version>
		<shade-plugin.version>3.5.2</shade-plugin.version>
		<maven-install-plugin.version>3.1.1</maven-install-plugin.version>
		<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
		<maven-javadoc-plugin.version>3.6.3</maven-javadoc-plugin.version>
		<maven-gpg-plugin.version>3.2.3</maven-gpg-plugin.version>
		<nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version> 
		
		<log4j.version>2.23.1</log4j.version>
		<google-api-services-mail.version>v1-rev20231218-2.0.0</google-api-services-mail.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-core</artifactId>
			<version>${log4j.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>jakarta.mail</groupId>
			<artifactId>jakarta.mail-api</artifactId>
			<version>2.1.3</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.angus</groupId>
			<artifactId>jakarta.mail</artifactId>
			<version>2.0.3</version>
		</dependency>
		<dependency>
			<groupId>com.google.apis</groupId>
			<artifactId>google-api-services-gmail</artifactId>
			<version>${google-api-services-mail.version}</version>
			<optional>true</optional>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>${compiler-plugin.version}</version>
			</plugin>
			<plugin>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>${surefire-plugin.version}</version>
			</plugin>
			<plugin>
				<artifactId>maven-install-plugin</artifactId>
				<version>${maven-install-plugin.version}</version>
			</plugin>
			<plugin>
				<artifactId>maven-shade-plugin</artifactId>
				<version>${shade-plugin.version}</version>
				<configuration>
					<shadedArtifactAttached>false</shadedArtifactAttached>
					<createDependencyReducedPom>false</createDependencyReducedPom>
					<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
					<minimizeJar>true</minimizeJar>
					<createSourcesJar>false</createSourcesJar>
					<relocations>
						<relocation>
							<pattern>com</pattern>
							<shadedPattern>${shade.package}.com</shadedPattern>
							<includes>
								<include>**</include>
							</includes>
						</relocation>
						<relocation>
							<pattern>io</pattern>
							<shadedPattern>${shade.package}.io</shadedPattern>
							<includes>
								<include>**</include>
							</includes>
						</relocation>
						<relocation>
							<pattern>javax.annotation</pattern>
							<shadedPattern>${shade.package}.javax.annotation</shadedPattern>
							<includes>
								<include>**</include>
							</includes>
						</relocation>
						<relocation>
							<pattern>mozilla</pattern>
							<shadedPattern>${shade.package}.mozilla</shadedPattern>
							<includes>
								<include>**</include>
							</includes>
						</relocation>
						<relocation>
							<pattern>org</pattern>
							<shadedPattern>${shade.package}.org</shadedPattern>
							<excludes>
								<exclude>org.apache.logging.log4j.**</exclude>
								<exclude>org.eclipse.angus.**</exclude>
							</excludes>
						</relocation>
					</relocations>
					<filters>
						<filter>
							<artifact>*:*</artifact>
							<excludes>
								<exclude>META-INF/*.SF</exclude>
								<exclude>META-INF/*.DSA</exclude>
								<exclude>META-INF/*.RSA</exclude>
								<exclude>META-INF/proguard/**</exclude>
								<exclude>META-INF/versions/**</exclude>
								<exclude>META-INF/DEPENDENCIES</exclude>
							</excludes>
						</filter>
					</filters>
					<artifactSet>
						<excludes>
							<exclude>org.apache.logging.log4j:log4j-core</exclude>
							<exclude>org.apache.logging.log4j:log4j-api</exclude>
							<exclude>jakarta.mail:jakarta.mail-api</exclude>
							<exclude>org.eclipse.angus:jakarta.mail</exclude>
							<exclude>org.eclipse.angus:angus-activation</exclude>
							<exclude>jakarta.activation:jakarta.activation-api</exclude>
						</excludes>
					</artifactSet>
					<transformers>
						<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer" />
					</transformers>
				</configuration>
				<executions>
					<execution>
						<id>shade-dependencies</id>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-invoker-plugin</artifactId>
				<version>3.6.0</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>
					<postBuildHookScript>verify</postBuildHookScript>
					<properties>
						<maven.compiler.source>${maven.compiler.source}</maven.compiler.source>
						<maven.compiler.target>${maven.compiler.target}</maven.compiler.target>
						<log4j.version>${log4j.version}</log4j.version>
						<appender.version>${project.version}</appender.version>
					</properties>
				</configuration>
				<executions>
					<execution>
						<id>run integration tests</id>
						<phase>integration-test</phase>
						<goals>
							<goal>install</goal>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-source-plugin</artifactId>
				<version>${maven-source-plugin.version}</version>
				<executions>
					<execution>
						<id>generate-sources</id>
						<phase>verify</phase>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>${maven-javadoc-plugin.version}</version>
				<executions>
					<execution>
						<id>javadoc</id>
						<phase>verify</phase>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</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>
</project>
