<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/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>

	<groupId>org.icatproject</groupId>
	<artifactId>datagateway-download-api</artifactId>
	<packaging>war</packaging>
	<version>4.0.0</version>
	<name>DataGateway Download API</name>
	<description>Download backend for DataGateway</description>

	<build>

		<extensions>
			<extension>
				<groupId>org.apache.maven.wagon</groupId>
				<artifactId>wagon-webdav-jackrabbit</artifactId>
				<version>2.10</version>
			</extension>
		</extensions>

		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>3.4.0</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.10.1</version>
				<inherited>true</inherited>
				<configuration>
					<release>11</release>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.4</version>
				<inherited>false</inherited>
				<configuration>
					<descriptors>
						<descriptor>${basedir}/src/assemble/distribution.xml</descriptor>
					</descriptors>
				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-site-plugin</artifactId>
				<version>3.4</version>
				<dependencies>
					<dependency><!-- add support for ssh/scp -->
						<groupId>org.apache.maven.wagon</groupId>
						<artifactId>wagon-ssh</artifactId>
						<version>2.10</version>
					</dependency>
				</dependencies>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>2.5.3</version>
				<configuration>
					<tagNameFormat>v@{project.version}</tagNameFormat>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
				<version>2.7</version>
				<dependencies>
					<dependency><!-- add support for ssh/scp -->
						<groupId>org.apache.maven.wagon</groupId>
						<artifactId>wagon-ssh</artifactId>
						<version>2.10</version>
					</dependency>
				</dependencies>
			</plugin>
			<plugin>
				<groupId>com.qmino</groupId>
				<artifactId>miredot-plugin</artifactId>
				<version>2.4.1-Java11</version>
				<executions>
					<execution>
						<goals>
							<goal>restdoc</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<licence>cHJvamVjdHxvcmcuaWNhdHByb2plY3QudG9wY2F0fDIwMjYtMDUtMTh8ZmFsc2V8LTEjTUN3Q0ZFRERHS042anNQVUZpOW80Wjdvc2VsVU50djBBaFFvd3lOU0UzWURiSHJmQVluZ0tpeWltbXl3QkE9PQ==</licence>
					<output>
						<html>
							<location>site/miredot</location>
							<baseUrl>https://example.com/topcat</baseUrl>
						</html>
					</output>
					<!-- apply for spring mvc support <restModel> <restFramework> <name>spring-mvc</name> 
						</restFramework> </restModel> -->
					<!-- insert other configuration here (optional) -->
				</configuration>
			</plugin>
		</plugins>
	</build>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.jboss.arquillian</groupId>
				<artifactId>arquillian-bom</artifactId>
				<version>1.9.5.Final</version>
				<scope>import</scope>
				<type>pom</type>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<dependency>
			<groupId>jakarta.platform</groupId>
			<artifactId>jakarta.jakartaee-api</artifactId>
			<version>10.0.0</version>
			<scope>provided</scope>
		</dependency>
		<!-- required for the @CascadeOnDelete annotation -->
		<dependency>
			<groupId>org.eclipse.persistence</groupId>
			<artifactId>org.eclipse.persistence.core</artifactId>
			<version>4.0.0</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<version>1.2.13</version>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter</artifactId>
			<version>5.13.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.jboss.arquillian.junit5</groupId>
			<artifactId>arquillian-junit5-container</artifactId>
			<scope>test</scope>
		</dependency>
		<!-- required for @Transactional annotation -->
		<dependency>
			<groupId>org.jboss.arquillian.extension</groupId>
			<artifactId>arquillian-transaction-api</artifactId>
			<version>2.0.0</version>
			<scope>test</scope>
		</dependency>
		<dependency>
		    <groupId>com.mysql</groupId>
		    <artifactId>mysql-connector-j</artifactId>
		    <version>9.1.0</version>
		    <scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.samaxes.filter</groupId>
			<artifactId>cachefilter</artifactId>
			<version>2.3.1</version>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-text</artifactId>
			<version>1.10.0</version>
		</dependency>
		<dependency>
			<groupId>commons-validator</groupId>
			<artifactId>commons-validator</artifactId>
			<version>1.7</version>
		</dependency>
		<dependency>
			<groupId>org.icatproject</groupId>
			<artifactId>icat.utils</artifactId>
			<version>4.16.1</version>
		</dependency>
	</dependencies>

	<profiles>
		<profile>
			<id>arquillian-glassfish-embedded</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<dependencies>
				<dependency>
					<groupId>org.omnifaces.arquillian</groupId>
					<artifactId>arquillian-glassfish-server-embedded</artifactId>
					<version>1.8</version>
					<scope>test</scope>
				</dependency>
				<dependency>
					<groupId>org.glassfish.main.extras</groupId>
					<artifactId>glassfish-embedded-all</artifactId>
					<version>7.0.25</version>
					<scope>test</scope>
				</dependency>
				<dependency>
					<groupId>org.apache.derby</groupId>
					<artifactId>derbytools</artifactId>
					<version>10.15.2.0</version>
					<scope>test</scope>
				</dependency>
				<!-- Enable dependency if you want to use H2 -->
				<!-- Also update glassfish-resources.xml to use H2 connection information -->
				<!-- <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> 
					<version>1.3.166</version> <scope>test</scope> </dependency> -->
			</dependencies>
			<build>
				<testResources>
					<testResource>
						<directory>src/test/resources</directory>
					</testResource>
					<testResource>
						<directory>src/test/resources-glassfish-embedded</directory>
					</testResource>
				</testResources>
				<plugins>
					<!-- The surefire plugin is configured to pass a system property to 
						GlassFish to retarget the derby log file -->
					<plugin>
						<artifactId>maven-surefire-plugin</artifactId>
						<version>3.5.3</version>
						<configuration>
							<!-- Required for jdk 17+ -->
							<argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine>

							<systemPropertyVariables>
								<java.util.logging.config.file>
									${project.build.testOutputDirectory}/logging.properties
								</java.util.logging.config.file>
								<derby.stream.error.file>
									${project.build.directory}/derby.log
								</derby.stream.error.file>
							</systemPropertyVariables>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<properties>
		<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<repoUrl>https://repo.icatproject.org/repo</repoUrl>
		<project.scm.id>github</project.scm.id>
	</properties>

	<repositories>
		<repository>
			<id>ICAT Repo</id>
			<url>https://repo.icatproject.org/repo</url>
		</repository>
	</repositories>

	<pluginRepositories>
		<pluginRepository>
			<id>miredot</id>
			<name>MireDot Releases</name>
			<url>https://secure-nexus.miredot.com/content/repositories/miredot</url>
		</pluginRepository>
	</pluginRepositories>

	<scm>
		<connection>scm:git:https://github.com/ral-facilities/datagateway-download-api.git</connection>
		<developerConnection>scm:git:https://github.com/ral-facilities/datagateway-download-api.git</developerConnection>
		<url>https://github.com/ral-facilities/datagateway-download-api</url>
		<tag>v4.0.0</tag>
	</scm>


	<issueManagement>
		<url>https://github.com/ral-facilities/datagateway-download-api/issues</url>
		<system>GitHub</system>
	</issueManagement>

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

	<organization>
		<name>The ICAT Collaboration</name>
		<url>http://www.icatproject.org</url>
	</organization>

	<distributionManagement>
		<downloadUrl>https://repo.icatproject.org/repo</downloadUrl>
		<site>
			<id>repo.icatproject.org</id>
			<url>dav:https://repo.icatproject.org/site/datagateway-download-api/${project.version}</url>
		</site>
		<repository>
			<id>repo.icatproject.org</id>
			<url>dav:https://repo.icatproject.org/repo</url>
		</repository>
	</distributionManagement>

	<reporting>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-project-info-reports-plugin</artifactId>
				<version>2.8.1</version>
				<configuration>
					<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
				</configuration>
				<reportSets>
					<reportSet>
						<reports>
							<report>index</report>
							<report>summary</report>
							<report>dependencies</report>
							<report>issue-tracking</report>
							<report>license</report>
							<report>plugins</report>
							<report>scm</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>

		</plugins>
	</reporting>
</project>

