<?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>webdav-nio-adapter-servlet</artifactId>
	<version>1.2.7</version>
	<name>WebDAV-NIO Adapter Servlet</name>
	<description>Servlet serving NIO directory contents as WebDAV resources.</description>
	<url>https://github.com/cryptomator/webdav-nio-adapter-servlet</url>

	<scm>
		<connection>scm:git:git@github.com:cryptomator/webdav-nio-adapter.git</connection>
		<developerConnection>scm:git:git@github.com:cryptomator/webdav-nio-adapter.git</developerConnection>
		<url>git@github.com:cryptomator/webdav-nio-adapter-servlet.git</url>
	</scm>

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

		<!-- dependencies -->
		<servlet.version>4.0.1</servlet.version>
		<jackrabbit.version>2.22.0</jackrabbit.version>
		<guava.version>33.4.0-jre</guava.version>
		<slf4j.version>2.0.17</slf4j.version>

		<!-- test dependencies -->
		<junit.jupiter.version>5.12.0</junit.jupiter.version>
		<mockito.version>5.15.2</mockito.version>
		<hamcrest.version>3.0</hamcrest.version>

		<!-- mvn plugins -->
		<mvn-compiler.version>3.14.0</mvn-compiler.version>
		<mvn-surefire.version>3.5.2</mvn-surefire.version>
		<mvn-jar.version>3.4.2</mvn-jar.version>
		<mvn-source.version>3.3.1</mvn-source.version>
		<mvn-javadoc.version>3.11.2</mvn-javadoc.version>
		<mvn-gpg.version>3.2.7</mvn-gpg.version>
		<dependency-check.version>12.1.0</dependency-check.version>
		<jacoco.version>0.8.12</jacoco.version>
		<central-publishing.version>0.7.0</central-publishing.version>
	</properties>

	<licenses>
		<license>
			<name>GNU Affero General Public License (AGPL) version 3.0</name>
			<url>https://www.gnu.org/licenses/agpl.txt</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>

	<dependencies>
		<!-- Jackrabbit -->
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<version>${servlet.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.jackrabbit</groupId>
			<artifactId>jackrabbit-webdav</artifactId>
			<version>${jackrabbit.version}</version>
			<exclusions>
				<exclusion>
					<!-- required by unused package org.apache.jackrabbit.webdav.client.methods
					 and unused class org.apache.jackrabbit.webdav.util.LinkHeaderFieldParser -->
					<groupId>org.apache.httpcomponents</groupId>
					<artifactId>httpclient</artifactId>
				</exclusion>
				<exclusion>
					<!-- not required, because commons logging is only used by excluded httpclient -->
					<groupId>org.slf4j</groupId>
					<artifactId>jcl-over-slf4j</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- Guava -->
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>${guava.version}</version>
		</dependency>

		<!-- Logging -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${slf4j.version}</version>
		</dependency>

		<!-- Test -->
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter</artifactId>
			<version>${junit.jupiter.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<version>${mockito.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest</artifactId>
			<version>${hamcrest.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-simple</artifactId>
			<version>${slf4j.version}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>${mvn-compiler.version}</version>
				<configuration>
					<release>11</release>
					<showWarnings>true</showWarnings>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>${mvn-surefire.version}</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>${mvn-jar.version}</version>
				<configuration>
					<archive>
						<manifestEntries>
							<Automatic-Module-Name>org.cryptomator.frontend.webdav.servlet</Automatic-Module-Name>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-source-plugin</artifactId>
				<version>${mvn-source.version}</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>${mvn-javadoc.version}</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>dependency-check</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.owasp</groupId>
						<artifactId>dependency-check-maven</artifactId>
						<version>${dependency-check.version}</version>
						<configuration>
							<nvdValidForHours>24</nvdValidForHours>
							<failBuildOnCVSS>6</failBuildOnCVSS>
							<skipTestScope>true</skipTestScope>
							<detail>true</detail>
							<nvdApiKeyEnvironmentVariable>NVD_API_KEY</nvdApiKeyEnvironmentVariable>
						</configuration>
						<executions>
							<execution>
								<goals>
									<goal>check</goal>
								</goals>
								<phase>validate</phase>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>coverage</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
						<version>${jacoco.version}</version>
						<executions>
							<execution>
								<id>prepare-agent</id>
								<goals>
									<goal>prepare-agent</goal>
								</goals>
								<configuration>
									<propertyName>surefire.jacoco.args</propertyName>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>sign</id>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>${mvn-gpg.version}</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
								<configuration>
									<signer>bc</signer>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>deploy-central</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.sonatype.central</groupId>
						<artifactId>central-publishing-maven-plugin</artifactId>
						<version>${central-publishing.version}</version>
						<extensions>true</extensions>
						<configuration>
							<publishingServerId>central</publishingServerId>
 							<autoPublish>true</autoPublish>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>deploy-github</id>
			<distributionManagement>
				<repository>
					<id>github</id>
					<name>GitHub Packages</name>
					<url>https://maven.pkg.github.com/cryptomator/webdav-nio-adapter-servlet</url>
				</repository>
			</distributionManagement>
		</profile>
	</profiles>

</project>
