<?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>org.cryptomator</groupId>
	<artifactId>siv-mode</artifactId>
	<version>1.3.2</version>

	<name>SIV Mode</name>
	<description>RFC 5297 SIV mode: deterministic authenticated encryption</description>
	<url>https://github.com/cryptomator/siv-mode</url>

	<scm>
		<connection>scm:git:git@github.com:cryptomator/siv-mode.git</connection>
		<developerConnection>scm:git:git@github.com:cryptomator/siv-mode.git</developerConnection>
		<url>git@github.com:cryptomator/siv-mode.git</url>
	</scm>

	<licenses>
		<license>
			<name>MIT License</name>
			<url>http://www.opensource.org/licenses/mit-license.php</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<developers>
		<developer>
			<name>Sebastian Stenzel</name>
			<email>sebastian.stenzel@gmail.com</email>
			<timezone>+1</timezone>
			<organization>cryptomator.org</organization>
			<organizationUrl>http://cryptomator.org</organizationUrl>
		</developer>
	</developers>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.bouncycastle</groupId>
			<artifactId>bcprov-jdk15on</artifactId>
			<version>1.64</version>
			<!-- see maven-shade-plugin; we don't want this as a transitive dependency in other projects -->
			<optional>true</optional>
		</dependency>

		<!-- Tests -->
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter</artifactId>
			<version>5.6.0</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<version>3.2.4</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest</artifactId>
			<version>2.2</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>28.2-jre</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.openjdk.jmh</groupId>
			<artifactId>jmh-core</artifactId>
			<version>1.23</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.openjdk.jmh</groupId>
			<artifactId>jmh-generator-annprocess</artifactId>
			<version>1.23</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<version>3.0.0-M3</version>
				<executions>
					<execution>
						<id>enforce-java</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<requireJavaVersion>
									<message>You need at least JDK 11.0.3 to build this project.</message>
									<version>[11.0.3,)</version>
								</requireJavaVersion>
							</rules>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.1</version>
				<configuration>
					<release>7</release>
					<testRelease>8</testRelease>
					<encoding>UTF-8</encoding>
					<showWarnings>true</showWarnings>
				</configuration>
				<executions>
					<execution>
						<id>java9</id>
						<phase>compile</phase>
						<goals>
							<goal>compile</goal>
						</goals>
						<configuration>
							<release>9</release>
							<compileSourceRoots>
								<compileSourceRoot>${project.basedir}/src/main/java9</compileSourceRoot>
							</compileSourceRoots>
							<multiReleaseOutput>true</multiReleaseOutput>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>3.0.0-M4</version>
			</plugin>
			<plugin>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.2.0</version>
				<configuration>
					<archive>
						<manifestEntries>
							<Multi-Release>true</Multi-Release>
							<Sealed>true</Sealed>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-shade-plugin</artifactId>
				<version>3.2.2</version>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
						<configuration>
							<minimizeJar>true</minimizeJar>
							<keepDependenciesWithProvidedScope>false</keepDependenciesWithProvidedScope>
							<createDependencyReducedPom>false</createDependencyReducedPom>
							<createSourcesJar>false</createSourcesJar>
							<artifactSet>
								<includes>
									<include>org.bouncycastle:bcprov-jdk15on</include>
								</includes>
							</artifactSet>
							<relocations>
								<relocation>
									<pattern>org.bouncycastle</pattern>
									<shadedPattern>org.cryptomator.siv.org.bouncycastle</shadedPattern>
								</relocation>
							</relocations>
							<filters>
								<filter>
									<artifact>*:*</artifact>
									<excludes>
										<exclude>META-INF/MANIFEST.MF</exclude>
										<exclude>META-INF/*.SF</exclude>
										<exclude>META-INF/*.DSA</exclude>
										<exclude>META-INF/*.RSA</exclude>
										<exclude>META-INF/services/**</exclude>
									</excludes>
								</filter>
							</filters>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>intellij</id>
			<!-- workaround for intellij bug: https://youtrack.jetbrains.com/issue/IDEA-85478 -->
			<activation>
				<activeByDefault>false</activeByDefault>
				<property>
					<name>idea.maven.embedder.version</name>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-compiler-plugin</artifactId>
						<version>3.8.1</version>
						<configuration>
							<release>8</release>
							<source>1.8</source>
							<target>1.8</target>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>dependency-check</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.owasp</groupId>
						<artifactId>dependency-check-maven</artifactId>
						<version>5.3.0</version>
						<configuration>
							<cveValidForHours>24</cveValidForHours>
							<failBuildOnCVSS>0</failBuildOnCVSS>
						</configuration>
						<executions>
							<execution>
								<goals>
									<goal>check</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>coverage</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
						<version>0.8.5</version>
						<executions>
							<execution>
								<id>prepare-agent</id>
								<goals>
									<goal>prepare-agent</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>release</id>
			<distributionManagement>
				<repository>
					<id>bintray-jcenter</id>
					<url>https://api.bintray.com/maven/cryptomator/maven/siv-mode/;publish=1</url>
				</repository>
			</distributionManagement>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-source-plugin</artifactId>
						<version>3.2.1</version>
						<executions>
							<execution>
								<id>attach-sources</id>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>3.1.1</version>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
