<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (C) 2007-2019 Crafter Software Corporation. All Rights Reserved.
  ~
  ~ This program is free software: you can redistribute it and/or modify
  ~ it under the terms of the GNU General Public License as published by
  ~ the Free Software Foundation, either version 3 of the License, or
  ~ (at your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~ GNU General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License
  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  -->

<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.craftercms</groupId>
	<artifactId>crafter-deployer</artifactId>
	<version>3.1.0</version><!-- craftercms version flag -->
	<packaging>jar</packaging>

	<name>Crafter Deployer</name>
	<description>Crafter deployer</description>

	<scm>
		<connection>scm:git:git://github.com/craftercms/deployer</connection>
		<developerConnection>scm:git:git://github.com/craftercms/deployer</developerConnection>
		<url>scm:git:git://github.com/craftercms/deployer</url>
	</scm>

	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.0.4.RELEASE</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>

	<properties>
		<!-- Version Numbers -->
		<commons.configuration.version>2.1</commons.configuration.version>
		<commons.csv.version>1.5</commons.csv.version>
		<jgit.version>5.2.0.201812061821-r</jgit.version>
		<javax.mail.version>1.4.7</javax.mail.version>
		<handlebars.version>4.0.6</handlebars.version>
		<mockito.version>1.10.19</mockito.version>
		<java.version>1.8</java.version>
		<!-- Override property setup by Spring Boot Parent -->
		<jackson.version>2.9.8</jackson.version>
		<aws.version>1.11.435</aws.version>
		<box.sdk.version>2.28.1</box.sdk.version>
		<elasticsearch.version>6.5.3</elasticsearch.version>

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

	<repositories>
		<repository>
			<id>sonatype-snapshots</id>
			<name>Sonatype Snapshots</name>
			<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
			<releases>
				<enabled>true</enabled>
				<updatePolicy>always</updatePolicy>
				<checksumPolicy>warn</checksumPolicy>
			</releases>
		</repository>
	</repositories>

	<dependencies>
		<!-- Crafter -->
		<dependency>
			<groupId>org.craftercms</groupId>
			<artifactId>crafter-commons-utilities</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>org.craftercms</groupId>
			<artifactId>crafter-commons-validation</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>org.craftercms</groupId>
			<artifactId>crafter-commons-git</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>org.craftercms</groupId>
			<artifactId>crafter-search-elasticsearch</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>org.craftercms</groupId>
			<artifactId>crafter-search-batch-indexer</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>org.craftercms</groupId>
			<artifactId>crafter-search-solr-client</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>org.craftercms</groupId>
			<artifactId>crafter-search-solr-api</artifactId>
			<version>${project.version}</version>
		</dependency>

		<!-- Commmons -->
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-configuration2</artifactId>
			<version>${commons.configuration.version}</version>
		</dependency>

		<!-- CSV -->
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-csv</artifactId>
			<version>${commons.csv.version}</version>
		</dependency>

		<!-- Spring -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
			<exclusions>
				<exclusion>
					<groupId>org.springframework.boot</groupId>
					<artifactId>spring-boot-starter-logging</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-log4j2</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>

		<!-- Git -->
		<dependency>
			<groupId>org.eclipse.jgit</groupId>
			<artifactId>org.eclipse.jgit</artifactId>
			<version>${jgit.version}</version>
		</dependency>

		<!-- Mail -->
		<dependency>
			<groupId>javax.mail</groupId>
			<artifactId>mail</artifactId>
			<version>${javax.mail.version}</version>
		</dependency>

		<!-- Handlebars -->
		<dependency>
			<groupId>com.github.jknack</groupId>
			<artifactId>handlebars</artifactId>
			<version>${handlebars.version}</version>
		</dependency>
		<dependency>
			<groupId>com.github.jknack</groupId>
			<artifactId>handlebars-springmvc</artifactId>
			<version>${handlebars.version}</version>
		</dependency>

		<!-- AWS -->
		<dependency>
			<groupId>com.amazonaws</groupId>
			<artifactId>aws-java-sdk-s3</artifactId>
		</dependency>
		<dependency>
			<groupId>com.amazonaws</groupId>
			<artifactId>aws-java-sdk-cloudfront</artifactId>
		</dependency>

		<!-- Box -->
		<dependency>
			<groupId>com.box</groupId>
			<artifactId>box-java-sdk</artifactId>
			<version>${box.sdk.version}</version>
		</dependency>

		<!-- Test -->
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-all</artifactId>
			<version>${mockito.version}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<dependencyManagement>
		<dependencies>
			<!-- AWS SDK -->
			<dependency>
				<groupId>com.amazonaws</groupId>
				<artifactId>aws-java-sdk-bom</artifactId>
				<version>${aws.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<finalName>crafter-deployer</finalName>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<configuration>
					<layout>ZIP</layout>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>repackage</goal>
						</goals>
						<configuration>
							<classifier>exec</classifier>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.4</version>
				<configuration>
					<archive>
						<manifest>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
						</manifest>
						<manifestEntries>
							<Implementation-Build>${buildNumber}</Implementation-Build>
							<Build-On>${timestamp}</Build-On>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>2.2.1</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>2.9</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>buildnumber-maven-plugin</artifactId>
				<version>1.2</version>
				<executions>
					<execution>
						<phase>validate</phase>
						<goals>
							<goal>create</goal>
							<goal>create-timestamp</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<doCheck>false</doCheck>
					<doUpdate>false</doUpdate>
					<revisionOnScmFailure>unknown</revisionOnScmFailure>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<systemPropertyVariables>
						<deployer.main.homePath>target/test-resources</deployer.main.homePath>
						<targets.dir>target/test-resources/targets</targets.dir>
						<deployments.dir>target/test-logs</deployments.dir>
						<processedCommits.dir>target/test-resources/processed-commits</processedCommits.dir>
						<logs.dir>target/test-logs</logs.dir>
					</systemPropertyVariables>
				</configuration>
			</plugin>

		</plugins>
	</build>


	<profiles>

		<profile>
			<id>release-sign-artifacts</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-deploy-plugin</artifactId>
						<version>2.7</version>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>1.4</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>JDK8</id>
			<activation>
				<jdk>[1.8,)</jdk>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>2.10.4</version>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
								<configuration>
									<additionalparam>-Xdoclint:none</additionalparam>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

	</profiles>


	<distributionManagement>
		<snapshotRepository>
			<id>sonatype-nexus-snapshots</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>sonatype-nexus-staging</id>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>
</project>
