<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>de.it-tw</groupId>
	<artifactId>log4j2-extras</artifactId>
	<version>1.1</version>
	<packaging>jar</packaging>

	<name>log4j2-extras</name>
	<description>
Some extras for log4j2 (requiring log4j 2.8+ and Java 7+):
- JUL-Handler as bridge from JUL to log4j2 - as alternative to JUL-LogManager, useful for webapps.
- Extended STMP appender with pattern in subject and burst handling.
	</description>
	<url>https://gitlab.com/thiesw/log4j2-extras</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>Thies Wellpott</name>
			<email>twapache@online.de</email>
			<organization>IT-TW</organization>
			<organizationUrl>http://it-tw.de</organizationUrl>
			<roles>
				<role>Architect</role>
				<role>Developer</role>
			</roles>
		</developer>
	</developers>

	<scm>
		<connection>scm:git:https://gitlab.com/thiesw/log4j2-extras.git</connection>
		<!-- no "ssh:" in devConn, see https://stackoverflow.com/questions/29120076/maven-and-gitlab-releaseprepare-uses-the-wrong-scm-url#45029330 -->
		<developerConnection>scm:git:git@gitlab.com:thiesw/log4j2-extras.git</developerConnection>
		<url>https://gitlab.com/thiesw/log4j2-extras/tree/master</url>
	</scm>


	<dependencies>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-api</artifactId>
			<version>${log4j.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-core</artifactId>
			<version>${log4j.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-jul</artifactId>
			<version>${log4j.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.sun.mail</groupId>
			<artifactId>javax.mail</artifactId>
			<version>${mail.version}</version>
			<scope>provided</scope>
		</dependency>

		<!-- Test libs -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
			<scope>test</scope>
		</dependency>
		<!-- does not work with JUL:
		<dependency>
			<groupId>com.github.stefanbirkner</groupId>
			<artifactId>system-rules</artifactId>
			<version>1.18.0</version>
			<scope>test</scope>
		</dependency> -->
	</dependencies>


	<build>
		<defaultGoal>clean package</defaultGoal>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.0</version>
				<configuration>
					<source>${jdk.version}</source>
					<target>${jdk.version}</target>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.22.0</version>
				<configuration>
					<systemPropertyVariables>
						<!-- needed for Log4jBridgeHandlerTest: -->
						<java.util.logging.config.file>src/test/resources/logging-test.properties</java.util.logging.config.file>
					</systemPropertyVariables>
					<excludes>
						<!-- this one takes really long and must be checked manually:
						     (and would require:  log4j.ExtendedSmtpAppenderTest.smtpHost, .smtpPort, .toEmail) -->
						<exclude>**/ExtendedSmtpAppenderTest.java</exclude>
					</excludes>
				</configuration>
			</plugin>
		</plugins>
	</build>


	<profiles>

		<profile>
			<!-- use this explicitly to create the all release artifacts and deploy via Sonatype to Maven Central -->
			<id>release</id>
			<build>
				<plugins>
					<!-- for deployment to public maven repository (sources, javadoc, gpg sign, deploy) -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<version>3.0.1</version>
						<executions>
							<execution>
								<id>attach-sources</id>
								<phase>verify</phase>		<!-- "verify": just before the install phase, not for "package" -->
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>3.0.1</version>
						<configuration>
							<!-- does not work for log4j2: <detectLinks>true</detectLinks> -->
							<links>https://logging.apache.org/log4j/2.x/log4j-api/apidocs</links>
						</configuration>
						<!-- NOTE: there will be some warnings because of missing @param, @return, @throws; they can be ignored -->
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<phase>verify</phase>
								<goals>
									<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>
									<keyname>${gpg.keyname}</keyname>
									<passphraseServerId>gpg_${gpg.keyname}</passphraseServerId>
								</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>


	<properties>
		<jdk.version>1.7</jdk.version>
		<log4j.version>2.11.1</log4j.version>		<!-- minimum is 2.8 (or 2.7 if "Core.CATEGORY_NAME" is not used) -->
		<mail.version>1.6.1</mail.version>
		<!-- development happens in Windows (cp1252 or iso8859-1), thus *no* UTF-8 source -->
		<project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding>
		<gpg.keyname>3D10C849</gpg.keyname>
	</properties>
</project>
