<?xml version="1.0"?>
<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.scytl.products.ov.sdm</groupId>
		<artifactId>ov-secure-data-manager-backend</artifactId>
		<version>2.1.6</version>
	</parent>

	<groupId>com.scytl.products.ov.sdm.ui</groupId>
	<artifactId>sdm-ws-rest</artifactId>
	<name>Secure Data Manager - Backend - Rest Webservices</name>
	<packaging>jar</packaging>

	<dependencies>
		<!-- Local dependencies -->
		<dependency>
			<groupId>com.scytl.products.ov.sdm.services</groupId>
			<artifactId>secure-data-manager-services</artifactId>
			<version>${project.version}</version>
			<exclusions>
				<exclusion>
					<groupId>org.codehaus.groovy</groupId>
					<artifactId>groovy</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.springframework</groupId>
					<artifactId>spring-tx</artifactId>
				</exclusion>
				<exclusion>
					<groupId>commons-collections</groupId>
					<artifactId>commons-collections</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>com.scytl.products.ov.channel.commons</groupId>
			<artifactId>ov-commons-dto</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.tomcat</groupId>
			<artifactId>tomcat-juli</artifactId>
		</dependency>
		<dependency>
			<groupId>org.codehaus.groovy</groupId>
			<artifactId>groovy</artifactId>
		</dependency>
		<dependency>
			<groupId>io.springfox</groupId>
			<artifactId>springfox-swagger2</artifactId>
			<version>${swagger.springfox.version}</version>
			<exclusions>
				<exclusion>
					<groupId>com.fasterxml.jackson.core</groupId>
					<artifactId>jackson-annotations</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-annotations</artifactId>
		</dependency>
		<dependency>
			<groupId>com.scytl.math</groupId>
			<artifactId>scytl-math</artifactId>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>com.scytl.cryptolib</groupId>
			<artifactId>cryptolib-certificates</artifactId>
            <type>test-jar</type>
			<scope>test</scope>
		</dependency>
		<!-- Used to allow pooling in spring rest client -->
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
		</dependency>
		<!-- Testing -->
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
			<exclusions>
				<exclusion>
					<groupId>com.fasterxml.jackson.core</groupId>
					<artifactId>jackson-databind</artifactId>
				</exclusion>
				<exclusion>
					<groupId>ch.qos.logback</groupId>
					<artifactId>logback-classic</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-core</artifactId>
		</dependency>
	</dependencies>

	<build>
		<finalName>${project.artifactId}</finalName>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<version>${spring-boot.version}</version>
				<configuration>
					<!-- The main class to start by executing java -jar -->
					<mainClass>com.scytl.products.ov.sdm.ui.ws.rs.application.Application</mainClass>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>repackage</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<version>2.7</version>
				<executions>
					<execution>
						<id>copy-resources</id>
						<!-- here the phase you need -->
						<phase>package</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${basedir}/target/sdmConfig</outputDirectory>
							<resources>
								<resource>
									<directory>sdmConfig</directory>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<configuration>
					<descriptor>assembly/package.xml</descriptor>
					<appendAssemblyId>false</appendAssemblyId>
					<finalName>sdmConfig</finalName>
				</configuration>
				<executions>
					<execution>
						<id>create-archive</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<!-- Cobertura Coverage -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>cobertura-maven-plugin</artifactId>
				<version>2.7</version>
				<configuration>
					<formats>
						<format>html</format>
						<format>xml</format>
					</formats>
					<check />
				</configuration>
			</plugin>
			<plugin>
				<groupId>com.github.kongchen</groupId>
				<artifactId>swagger-maven-plugin</artifactId>
				<version>${swagger.mavenplugin.version}</version>
				<configuration>
					<apiSources>
						<apiSource>
							<springmvc>true</springmvc>
							<locations>com.scytl.products.ov.sdm</locations>
							<schemes>http,https</schemes>
							<host>localhost:8090</host>
							<basePath />
							<info>
								<title>Secure Data Manager</title>
								<version>v1</version>
								<description>Secure Data Manager REST API</description>
								<termsOfService>
									http://www.scytl.com/terms-of-service
								</termsOfService>
								<contact>
									<email>product.ov@scytl.com</email>
									<name>Scytl Product - Online Voting Product</name>
									<url />
								</contact>
								<license>
									<url>http://www.scytl.com/licenses</url>
									<name>Scytl License</name>
								</license>
							</info>
							<swaggerDirectory>${basedir}/target/generated/swagger-ui</swaggerDirectory>
						</apiSource>
					</apiSources>
				</configuration>
				<executions>
					<execution>
						<phase>compile</phase>
						<goals>
							<goal>generate</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>

	</build>

</project>
