<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>tech.barbero.http-messages-signing</groupId>
	<artifactId>http-messages-signing-parent</artifactId>
	<version>1.0.0</version>
	<name>HTTP Messages Signing Parent</name>
	<packaging>pom</packaging>

	<description>Implementation of the Internet-Draft "Signing HTTP Messages", draft-cavage-http-signatures-09, https://tools.ietf.org/html/draft-cavage-http-signatures-09</description>
	<url>https://github.com/mbarbero/http-messages-signing</url>

	<scm>
		<url>https://github.com/mbarbero/http-messages-signing/</url>
		<connection>scm:git:https://github.com/mbarbero/http-messages-signing.git</connection>
		<developerConnection>scm:git:git@github.com:mbarbero/http-messages-signing.git</developerConnection>
		<tag>HEAD</tag>
	</scm>

	<issueManagement>
		<system>GitHub Issues</system>
		<url>https://github.com/mbarbero/http-messages-signing/issues</url>
	</issueManagement>

	<licenses>
		<license>
			<name>Eclipse Public License 2.0</name>
			<url>https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt</url>
		</license>
	</licenses>

	<developers>
		<developer>
			<id>mbarbero</id>
			<name>Mikaël Barbero</name>
			<email>mikael.barbero@gmail.com</email>
			<roles>
				<role>owner</role>
				<role>developer</role>
			</roles>
			<timezone>+1</timezone>
		</developer>
	</developers>

	<modules>
		<module>core</module>
		<module>servlet</module>
		<module>ahc4</module>
		<module>okhttp3</module>
	</modules>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<java.source.target.version>1.8</java.source.target.version>

		<junit.jupiter.version>5.0.3</junit.jupiter.version>
		<junit.platform.version>1.0.3</junit.platform.version>
	</properties>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.apache.httpcomponents</groupId>
				<artifactId>httpcore</artifactId>
				<version>${org.apache.httpcomponents.httpcore.version}</version>
			</dependency>
			<dependency>
				<groupId>com.squareup.okhttp3</groupId>
				<artifactId>okhttp</artifactId>
				<version>${com.squareup.okhttp3.okhttp.version}</version>
			</dependency>
			<dependency> <!-- will be shaded -->
				<groupId>com.google.guava</groupId>
				<artifactId>guava</artifactId>
				<version>24.0-jre</version>
			</dependency>
			<dependency>
				<groupId>com.google.auto.value</groupId>
				<artifactId>auto-value</artifactId>
				<version>1.5</version>
				<scope>provided</scope>
			</dependency>
			<dependency>
				<groupId>javax.servlet</groupId>
				<artifactId>javax.servlet-api</artifactId>
				<version>${javax.servlet-api.version}</version>
				<scope>provided</scope>
			</dependency>
			<dependency>
				<groupId>org.osgi</groupId>
				<artifactId>org.osgi.annotation</artifactId>
				<version>6.0.0</version>
				<scope>provided</scope>
			</dependency>
			<dependency>
				<groupId>org.junit.jupiter</groupId>
				<artifactId>junit-jupiter-api</artifactId>
				<version>${junit.jupiter.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.junit.jupiter</groupId>
				<artifactId>junit-jupiter-engine</artifactId>
				<version>${junit.jupiter.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency> <!-- For Eclipse test run -->
				<groupId>org.junit.platform</groupId>
				<artifactId>junit-platform-launcher</artifactId>
				<version>${junit.platform.version}</version>
				<scope>test</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<dependency>
			<groupId>org.osgi</groupId>
			<artifactId>org.osgi.annotation</artifactId>
		</dependency>
		<dependency> <!-- For Surefire test run -->
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-engine</artifactId>
		</dependency>
		<dependency> <!-- For Eclipse test run -->
			<groupId>org.junit.platform</groupId>
			<artifactId>junit-platform-launcher</artifactId>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>biz.aQute.bnd</groupId>
				<artifactId>bnd-maven-plugin</artifactId>
			</plugin>
		</plugins>

		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.7.0</version>
					<configuration>
						<compilerId>javac-with-errorprone</compilerId>
						<showWarnings>true</showWarnings>
						<showDeprecation>true</showDeprecation>
						<forceJavacCompilerUse>true</forceJavacCompilerUse>
						<source>${java.source.target.version}</source>
						<target>${java.source.target.version}</target>
					</configuration>
					<dependencies>
						<dependency>
							<groupId>org.codehaus.plexus</groupId>
							<artifactId>plexus-compiler-javac-errorprone</artifactId>
							<version>2.8.1</version>
						</dependency>
						<dependency>
							<groupId>com.google.errorprone</groupId>
							<artifactId>error_prone_core</artifactId>
							<version>2.0.16</version>
						</dependency>
					</dependencies>
				</plugin>

				<plugin>
					<groupId>com.github.spotbugs</groupId>
					<artifactId>spotbugs-maven-plugin</artifactId>
					<version>3.1.1</version>
					<executions>
						<execution>
							<id>spotbugs-default</id>
							<goals>
								<goal>check</goal>
							</goals>
							<configuration>
								<includeTests>true</includeTests>
							</configuration>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>biz.aQute.bnd</groupId>
					<artifactId>bnd-maven-plugin</artifactId>
					<version>3.5.0</version>
					<executions>
						<execution>
							<goals>
								<goal>bnd-process</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>3.0.2</version>
					<configuration>
						<archive>
							<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
						</archive>
					</configuration>
					<executions>
						<execution>
							<goals>
								<goal>test-jar</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.19.1</version>
					<dependencies>
						<dependency>
							<groupId>org.junit.platform</groupId>
							<artifactId>junit-platform-surefire-provider</artifactId>
							<version>${junit.platform.version}</version>
						</dependency>
						<dependency>
							<groupId>org.junit.jupiter</groupId>
							<artifactId>junit-jupiter-engine</artifactId>
							<version>${junit.jupiter.version}</version>
						</dependency>
					</dependencies>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-shade-plugin</artifactId>
					<version>3.1.0</version>
					<executions>
						<execution>
							<id>shade-internal-dependencies</id>
							<phase>package</phase>
							<goals>
								<goal>shade</goal>
							</goals>
							<configuration>
								<minimizeJar>true</minimizeJar>
							</configuration>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>3.0.1</version>
					<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>
					<version>3.0.0</version>
					<configuration>
						<links>
							<link>https://hc.apache.org/httpcomponents-core-4.4.x/httpcore/apidocs/</link>
							<link>http://square.github.io/okhttp/3.x/okhttp/</link>
							<link>https://docs.oracle.com/javaee/7/api/</link>
						</links>
					</configuration>
					<executions>
						<execution>
							<id>attach-javadocs</id>
							<goals>
								<goal>jar</goal>
							</goals>
						</execution>
						<execution>
							<id>aggregate</id>
							<goals>
								<goal>aggregate</goal>
							</goals>
							<phase>package</phase>
							<configuration>
								<destDir>${project.version}</destDir>
							</configuration>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-enforcer-plugin</artifactId>
					<version>3.0.0-M1</version>
					<executions>
						<execution>
							<id>enforce-maven</id>
							<goals>
								<goal>enforce</goal>
							</goals>
							<configuration>
								<rules>
									<requireMavenVersion>
										<version>3.5.2</version>
									</requireMavenVersion>
								</rules>
							</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>false</autoReleaseAfterClose>
					</configuration>
				</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>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-clean-plugin</artifactId>
					<version>3.0.0</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<version>3.0.2</version>
					<executions>
						<execution>
							<id>copy-resources</id>
							<phase>prepare-package</phase>
							<goals>
								<goal>copy-resources</goal>
							</goals>
							<configuration>
								<outputDirectory>${project.build.outputDirectory}/META-INF/</outputDirectory>
								<resources>
									<resource>
										<directory>${project.basedir}/..</directory>
										<includes>
											<include>LICENSE</include>
											<include>NOTICE.adoc</include>
										</includes>
									</resource>
								</resources>
							</configuration>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-checkstyle-plugin</artifactId>
					<version>3.0.0</version>
					<dependencies>
						<dependency>
							<groupId>com.puppycrawl.tools</groupId>
							<artifactId>checkstyle</artifactId>
							<version>8.8</version>
						</dependency>
					</dependencies>
					<configuration>
						<failsOnError>true</failsOnError>
						<configLocation>releng/reporting/checkstyle.xml</configLocation>
						<headerLocation>releng/reporting/EPLv2.regexp.txt</headerLocation>
						<consoleOutput>true</consoleOutput>
						<linkXRef>false</linkXRef>
						<excludes>**/AutoValue_*.java</excludes>
						<includeTestSourceDirectory>true</includeTestSourceDirectory>
					</configuration>
					<executions>
						<execution>
							<phase>verify</phase>
							<goals>
								<goal>checkstyle</goal>
							</goals>
						</execution>
					</executions>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-site-plugin</artifactId>
					<version>3.7</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>2.8.2</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-install-plugin</artifactId>
					<version>2.5.2</version>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<prerequisites> <!-- versions:display-plugin-updates needs this for proper report -->
		<maven>3.0.4</maven>
	</prerequisites>

	<profiles>
		<profile>
			<id>compile</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<properties>
				<org.apache.httpcomponents.httpcore.version>[4.0]</org.apache.httpcomponents.httpcore.version>
				<com.squareup.okhttp3.okhttp.version>[3.0.1]</com.squareup.okhttp3.okhttp.version>
				<javax.servlet-api.version>[3.0.1]</javax.servlet-api.version>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>com.github.spotbugs</groupId>
						<artifactId>spotbugs-maven-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-checkstyle-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>prepare-deploy</id>
			<properties>
				<!-- When you want to exclude next major version from a range with maven, 
					you need to exclude MAJOR-alpha-SNAPSHOT as per https://github.com/apache/maven/blob/maven-3.5.2/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java -->
				<org.apache.httpcomponents.httpcore.version>[4.0, 5.0-alpha-SNAPSHOT)</org.apache.httpcomponents.httpcore.version>
				<com.squareup.okhttp3.okhttp.version>[3.0.1, 4.0-alpha-SNAPSHOT)</com.squareup.okhttp3.okhttp.version>
				<javax.servlet-api.version>[3.0.1, 5.0-alpha-SNAPSHOT)</javax.servlet-api.version>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>deploy</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<configuration>
							<homedir>${env.GPG_HOME}</homedir>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
					</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>
</project>