<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>

	<parent>
		<groupId>com.erudika</groupId>
		<artifactId>para-parent</artifactId>
		<version>1.52.2</version>
	</parent>

	<artifactId>para-server</artifactId>
	<packaging>jar</packaging>
	<name>para-server</name>

	<properties>
		<springSecVer>7.0.2</springSecVer>
		<springLdapVer>4.0.1</springLdapVer>
		<openSamlVer>5.1.6</openSamlVer>

		<!-- PLUGINS -->
		<!--===== LUCENE =====-->
		<lucenePluginVer>1.49.5</lucenePluginVer>
		<!--===== SQL =====-->
		<sqlPluginVer>1.49.3</sqlPluginVer>
		<!--===== HAZELCAST =====-->
		<hcPluginVer>1.42.0</hcPluginVer>
		<!--===== CASSANDRA =====-->
		<casPluginVer>1.42.0</casPluginVer>
		<!--===== MONGODB =====-->
		<mongoPluginVer>1.42.2</mongoPluginVer>
		<!--===== ELASTICSEARCH =====-->
		<esPluginVer>1.42.2</esPluginVer>
		<!--===== DYNAMODB =====-->
		<dynamoPluginVer>1.52.1</dynamoPluginVer>
		<!--===== AWS SES =====-->
		<sesPluginVer>1.52.1</sesPluginVer>
		<!--===== AWS S3 =====-->
		<s3PluginVer>1.52.1</s3PluginVer>
		<!--===== AWS SQS =====-->
		<sqsPluginVer>1.52.1</sqsPluginVer>
	</properties>

	<dependencies>
		<dependency>
			<groupId>com.erudika</groupId>
			<artifactId>para-core</artifactId>
			<version>${project.version}</version>
		</dependency>

		<!-- SPRING SECURITY -->
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-core</artifactId>
			<exclusions>
				<exclusion>
					<groupId>org.springframework</groupId>
					<artifactId>spring-jcl</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-web</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-config</artifactId>
			<exclusions>
				<exclusion>
					<groupId>org.jetbrains.kotlin</groupId>
					<artifactId>kotlin-stdlib-jdk8</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.jetbrains.kotlin</groupId>
					<artifactId>kotlin-stdlib</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.jetbrains.kotlin</groupId>
					<artifactId>kotlin-reflect</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-saml2-service-provider</artifactId>
		</dependency>
		<!-- SPRING BOOT -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
			<exclusions>
				<exclusion>
					<groupId>org.springframework.boot</groupId>
					<artifactId>spring-boot-starter-jetty</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.apache.logging.log4j</groupId>
					<artifactId>log4j-to-slf4j</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-mail</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-ldap</artifactId>
		</dependency>
		<!-- SPRING LDAP -->
		<dependency>
			<groupId>org.springframework.ldap</groupId>
			<artifactId>spring-ldap-core</artifactId>
		</dependency>

		<!-- SAML -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-security-saml2</artifactId>
		</dependency>
		<dependency>
			<groupId>org.opensaml</groupId>
			<artifactId>opensaml-saml-api</artifactId>
			<version>${openSamlVer}</version>
		</dependency>
		<dependency>
			<groupId>org.opensaml</groupId>
			<artifactId>opensaml-saml-impl</artifactId>
			<version>${openSamlVer}</version>
		</dependency>

		<!--	 CAFFEINE -->
		<dependency>
			<groupId>com.github.ben-manes.caffeine</groupId>
			<artifactId>caffeine</artifactId>
		</dependency>

		<!-- METRICS -->
		<dependency>
			<groupId>io.dropwizard.metrics</groupId>
			<artifactId>metrics-jmx</artifactId>
			<version>${metricsVer}</version>
		</dependency>
		<dependency>
			<groupId>io.dropwizard.metrics</groupId>
			<artifactId>metrics-graphite</artifactId>
			<version>${metricsVer}</version>
			<exclusions>
				<exclusion>
					<groupId>joda-time</groupId>
					<artifactId>joda-time</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.google.code.findbugs</groupId>
					<artifactId>jsr305</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.hibernate</groupId>
					<artifactId>hibernate-validator</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- OTHER -->
		<dependency>
			<groupId>org.yaml</groupId>
			<artifactId>snakeyaml</artifactId>
		</dependency>
		<dependency>
			<groupId>com.nimbusds</groupId>
			<artifactId>nimbus-jose-jwt</artifactId>
			<version>10.7</version>
		</dependency>

		<!-- TESTING -->
		<dependency>
			<groupId>com.erudika</groupId>
			<artifactId>para-client</artifactId>
			<version>${project.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.erudika</groupId>
			<artifactId>para-search-lucene</artifactId>
			<version>${lucenePluginVer}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.ldap</groupId>
			<artifactId>spring-ldap-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.unboundid</groupId>
			<artifactId>unboundid-ldapsdk</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>2.21.0</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>

			<plugin>
				<artifactId>maven-clean-plugin</artifactId>
				<version>3.5.0</version>
				<configuration>
					<filesets>
						<fileset>
							<directory>data</directory>
							<includes>
								<include>**/**</include>
							</includes>
							<followSymlinks>false</followSymlinks>
						</fileset>
					</filesets>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<version>3.6.0</version>
				<dependencies>
					<dependency>
						<groupId>com.puppycrawl.tools</groupId>
						<artifactId>checkstyle</artifactId>
						<version>9.2</version>
					</dependency>
				</dependencies>
				<executions>
					<execution>
						<id>validate-server</id>
						<phase>validate</phase>
						<configuration>
							<skip>${skipTests}</skip>
							<configLocation>../para-core/src/main/resources/checkstyle.xml</configLocation>
							<consoleOutput>true</consoleOutput>
							<failsOnError>true</failsOnError>
							<linkXRef>false</linkXRef>
						</configuration>
						<goals>
							<goal>check</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>3.12.0</version>
				<configuration>
					<sourcepath>src/main/java</sourcepath>
					<!--<stylesheetfile>para-core/src/main/javadoc/stylesheet.css</stylesheetfile>-->
					<show>public</show>
					<quiet>true</quiet>
					<!--<docfilessubdirs>true</docfilessubdirs>-->
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.5.0</version>
				<configuration>
					<archive>
						<manifestEntries>
							<Automatic-Module-Name>com.erudika.para.server</Automatic-Module-Name>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>default</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<dependencies>
				<dependency>
					<groupId>com.erudika</groupId>
					<artifactId>para-dao-sql</artifactId>
					<version>${sqlPluginVer}</version>
				</dependency>
				<dependency>
					<groupId>com.erudika</groupId>
					<artifactId>para-search-lucene</artifactId>
					<version>${lucenePluginVer}</version>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>lucene</id>
			<dependencies>
				<dependency>
					<groupId>com.erudika</groupId>
					<artifactId>para-search-lucene</artifactId>
					<version>${lucenePluginVer}</version>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>sql</id>
			<dependencies>
				<dependency>
					<groupId>com.erudika</groupId>
					<artifactId>para-dao-sql</artifactId>
					<version>${sqlPluginVer}</version>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>dynamodb</id>
			<dependencies>
				<dependency>
					<groupId>com.erudika</groupId>
					<artifactId>para-dao-dynamodb</artifactId>
					<version>${dynamoPluginVer}</version>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>ses</id>
			<dependencies>
				<dependency>
					<groupId>com.erudika</groupId>
					<artifactId>para-email-ses</artifactId>
					<version>${sesPluginVer}</version>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>s3</id>
			<dependencies>
				<dependency>
					<groupId>com.erudika</groupId>
					<artifactId>para-storage-s3</artifactId>
					<version>${s3PluginVer}</version>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>sqs</id>
			<dependencies>
				<dependency>
					<groupId>com.erudika</groupId>
					<artifactId>para-queue-sqs</artifactId>
					<version>${sqsPluginVer}</version>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>hazelcast</id>
			<dependencies>
				<dependency>
					<groupId>com.erudika</groupId>
					<artifactId>para-cache-hazelcast</artifactId>
					<version>${hcPluginVer}</version>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>cassandra</id>
			<dependencies>
				<dependency>
					<groupId>com.erudika</groupId>
					<artifactId>para-dao-cassandra</artifactId>
					<version>${casPluginVer}</version>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>mongodb</id>
			<dependencies>
				<dependency>
					<groupId>com.erudika</groupId>
					<artifactId>para-dao-mongodb</artifactId>
					<version>${mongoPluginVer}</version>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>elasticsearch</id>
			<dependencies>
				<dependency>
					<groupId>com.erudika</groupId>
					<artifactId>para-search-elasticsearch</artifactId>
					<version>${esPluginVer}</version>
				</dependency>
			</dependencies>
		</profile>

		<profile>
			<id>native</id>
			<properties>
				<!--<packaging.type>jar</packaging.type>-->
				<M_ARCH>native</M_ARCH>
			</properties>
			<dependencies>
				<dependency>
					<groupId>com.erudika</groupId>
					<artifactId>para-dao-sql</artifactId>
					<version>${sqlPluginVer}</version>
				</dependency>
				<dependency>
					<groupId>com.erudika</groupId>
					<artifactId>para-search-lucene</artifactId>
					<version>${lucenePluginVer}</version>
				</dependency>
			</dependencies>
			<build>
				<resources>
					<resource>
						<directory>src/main/resources/</directory>
						<excludes>
							<exclude>logback.xml</exclude>
						</excludes>
					</resource>
				</resources>
				<plugins>
					<plugin>
						<groupId>org.graalvm.buildtools</groupId>
						<artifactId>native-maven-plugin</artifactId>
						<extensions>true</extensions>
						<executions>
							<execution>
								<id>build-native</id>
								<goals>
									<goal>compile-no-fork</goal>
								</goals>
								<phase>package</phase>
							</execution>
						</executions>
						<configuration>
							<buildArgs>
								<buildArg>-march=${M_ARCH}</buildArg>
								<buildArg>-R:MaxHeapSize=800m</buildArg>
								<buildArg>-H:+SharedArenaSupport</buildArg>
								<buildArg>-H:+UnlockExperimentalVMOptions</buildArg>
								<buildArg>-H:+IncludeAllLocales</buildArg>
								<buildArg>--enable-http</buildArg>
								<buildArg>--enable-https</buildArg>
								<buildArg>--enable-native-access=ALL-UNNAMED</buildArg>
								<buildArg>--initialize-at-build-time=com.ctc.wstx</buildArg>
								<buildArg>--initialize-at-build-time=com.ctc.wstx.stax.WstxInputFactory</buildArg>
								<buildArg>--initialize-at-build-time=com.ctc.wstx.stax.WstxOutputFactory</buildArg>
								<buildArg>--initialize-at-build-time=org.codehaus.stax2.typed.Base64Variant</buildArg>
								<buildArg>--initialize-at-build-time=org.springframework.boot.loader.nio.file.NestedFileSystemProvider</buildArg>
								<buildArg>--initialize-at-run-time=org.slf4j.LoggerFactory</buildArg>
							</buildArgs>
							<mainClass>com.erudika.para.server.ParaServer</mainClass>
							<agentConfiguration>
								<enabled>true</enabled>
							</agentConfiguration>
							<metadataRepository>
								<enabled>true</enabled>
							</metadataRepository>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.springframework.boot</groupId>
						<artifactId>spring-boot-maven-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<repositories>
		<repository>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
			<id>opensaml</id>
			<name>OpenSAML</name>
			<url>https://build.shibboleth.net/nexus/content/repositories/releases/</url>
		</repository>
	</repositories>

</project>
