<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.13</version>
	</parent>

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

	<properties>
		<jerseyVer>2.16</jerseyVer>
		<springVer>4.0.0.RELEASE</springVer>
		<springVer2>1.2.2.RELEASE</springVer2>
		<jacksonVer>2.5.1</jacksonVer>
		<hazelcastVer>3.4.1</hazelcastVer>
		<awsJdkVer>1.9.24</awsJdkVer>
	</properties>

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

		<!-- SPRING -->
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-core</artifactId>
			<version>${springVer}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-web</artifactId>
			<version>${springVer}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-openid</artifactId>
			<version>${springVer}</version>
			<exclusions>
				<exclusion>
					<artifactId>commons-logging</artifactId>
					<groupId>commons-logging</groupId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-config</artifactId>
			<version>${springVer}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter</artifactId>
			<version>${springVer2}</version>
			<exclusions>
				<exclusion>
					<artifactId>spring-boot-starter-tomcat</artifactId>
					<groupId>org.springframework.boot</groupId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-logging</artifactId>
			<version>${springVer2}</version>
		</dependency>
<!--		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
			<version>${springVer2}</version>
		</dependency>-->


		<!-- ELASTICSEARCH -->
		<dependency>
			<groupId>org.elasticsearch</groupId>
			<artifactId>elasticsearch</artifactId>
			<version>1.5.0</version>
		</dependency>
		<dependency>
			<groupId>org.elasticsearch</groupId>
			<artifactId>elasticsearch-cloud-aws</artifactId>
			<version>2.5.0</version>
			<exclusions>
				<exclusion>
					<groupId>com.amazonaws</groupId>
					<artifactId>aws-java-sdk</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- HAZELCAST -->
		<dependency>
			<groupId>com.hazelcast</groupId>
			<artifactId>hazelcast</artifactId>
			<version>${hazelcastVer}</version>
		</dependency>
		<dependency>
			<groupId>com.hazelcast</groupId>
			<artifactId>hazelcast-cloud</artifactId>
			<version>${hazelcastVer}</version>
		</dependency>

		<!-- AWS JAVA SDK -->
		<dependency>
			<groupId>com.amazonaws</groupId>
			<artifactId>aws-java-sdk-ec2</artifactId>
			<version>${awsJdkVer}</version>
		</dependency>
		<dependency>
			<groupId>com.amazonaws</groupId>
			<artifactId>aws-java-sdk-dynamodb</artifactId>
			<version>${awsJdkVer}</version>
		</dependency>
		<dependency>
			<groupId>com.amazonaws</groupId>
			<artifactId>aws-java-sdk-s3</artifactId>
			<version>${awsJdkVer}</version>
		</dependency>
		<dependency>
			<groupId>com.amazonaws</groupId>
			<artifactId>aws-java-sdk-ses</artifactId>
			<version>${awsJdkVer}</version>
		</dependency>
		<dependency>
			<groupId>com.amazonaws</groupId>
			<artifactId>aws-java-sdk-sqs</artifactId>
			<version>${awsJdkVer}</version>
		</dependency>

		<!-- OTHER -->
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpcore</artifactId>
			<!-- Skip 4.4 because it causes SSL exceptions with some hostnames-->
			<version>4.3.3</version>
		</dependency>
		<dependency>
			<!-- Skip 4.4 because it causes SSL exceptions with some hostnames-->
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<!-- Skip 4.4 because it causes SSL exceptions with some hostnames-->
			<version>4.3.6</version>
		</dependency>
		<dependency>
			<groupId>javax</groupId>
			<artifactId>javaee-web-api</artifactId>
			<version>7.0</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.ebaysf.web</groupId>
			<artifactId>cors-filter</artifactId>
			<version>1.0.1</version>
		</dependency>

		<!-- TESTING -->
		<dependency>
			<groupId>com.erudika</groupId>
			<artifactId>para-client</artifactId>
			<version>${project.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.elasticmq</groupId>
			<artifactId>elasticmq-rest-sqs_2.10</artifactId>
			<version>0.7.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jersey.test-framework.providers</groupId>
			<artifactId>jersey-test-framework-provider-inmemory</artifactId>
			<version>${jerseyVer}</version>

			<!--<scope>test</scope>-->
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.6</version>
				<configuration>
					<excludes>
						<exclude>**/rebel.xml</exclude>
					</excludes>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.eclipse.jetty</groupId>
				<artifactId>jetty-maven-plugin</artifactId>
				<version>9.2.10.v20150310</version>
				<configuration>
					<systemProperties>
						<systemProperty>
							<name>org.eclipse.jetty.util.log.Log</name>
							<value>org.eclipse.jetty.util.log.Slf4jLog</value>
						</systemProperty>
						<systemProperty>
							<name>logback.configurationFile</name>
							<value>${basedir}/src/main/resources/logback.xml</value>
						</systemProperty>
					</systemProperties>
					<webApp>
						<contextPath>/</contextPath>
					</webApp>
					<reload>manual</reload>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>org.slf4j</groupId>
						<artifactId>slf4j-api</artifactId>
						<version>${slf4jVer}</version>
					</dependency>
				</dependencies>
			</plugin>

			<plugin>
				<groupId>com.jcabi</groupId>
				<artifactId>jcabi-dynamodb-maven-plugin</artifactId>
				<version>0.7.1</version>
				<executions>
					<execution>
						<id>dynamodb-integration-test</id>
						<goals>
							<goal>start</goal>
							<goal>stop</goal>
						</goals>
						<configuration>
							<scope>test</scope>
							<skip>${skipITs}</skip>
							<port>8000</port>
							<dist>${project.build.directory}/dynamodb-dist</dist>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>2.10</version>
				<executions>
					<execution>
						<id>unpack-dynamodb-local</id>
						<goals>
							<goal>unpack</goal>
						</goals>
						<configuration>
							<scope>test</scope>
							<skip>${skipITs}</skip>
							<artifactItems>
								<artifactItem>
									<groupId>com.jcabi</groupId>
									<artifactId>DynamoDBLocal</artifactId>
									<version>2014-01-08</version>
									<type>zip</type>
									<outputDirectory>${project.build.directory}/dynamodb-dist</outputDirectory>
									<overWrite>false</overWrite>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<version>2.15</version>
				<executions>
					<execution>
						<id>validate-server</id>
						<phase>validate</phase>
						<configuration>
							<skip>${skipTests}</skip>
							<configLocation>${basedir}/src/main/resources/checkstyle.xml</configLocation>
							<encoding>UTF-8</encoding>
							<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>2.10.2</version>
				<executions>
					<execution>
						<id>javadocs</id>
						<goals>
							<goal>javadoc</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<stylesheetfile>../para-core/src/main/javadoc/stylesheet.css</stylesheetfile>
					<show>public</show>
					<aggregate>true</aggregate>
					<quiet>true</quiet>
					<docfilessubdirs>true</docfilessubdirs>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>fatjar</id>
			<activation>
				<property>
					<name>fatJAR</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.springframework.boot</groupId>
						<artifactId>spring-boot-maven-plugin</artifactId>
						<version>${springVer2}</version>
						<executions>
							<execution>
								<goals>
									<goal>repackage</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
