<?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.mixing</groupId>
		<artifactId>mixing</artifactId>
		<version>0.3.2</version>
	</parent>

	<artifactId>mixing-spring</artifactId>
	<name>Online Voting - Mixnet - Spring</name>

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

	<dependencies>

		<!-- internal project dependencies -->
		<dependency>
			<groupId>com.scytl.mixing</groupId>
			<artifactId>mixing-engine</artifactId>
			<version>${project.version}</version>
		</dependency>

        <dependency>
          <groupId>com.scytl.mixing</groupId>
          <artifactId>mixing-commons</artifactId>
          <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.scytl.math</groupId>
            <artifactId>scytl-math</artifactId>
            <scope>provided</scope>
        </dependency> 
		<dependency>
			<groupId>com.scytl.mixing</groupId>
			<artifactId>mixing-commons</artifactId>
			<version>${project.version}</version>
			<type>test-jar</type>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-test</artifactId>
			<scope>test</scope>
		</dependency>

  </dependencies>

	<build>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
				<includes>
					<include>**/version.txt</include>
				</includes>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>false</filtering>
				<excludes>
					<exclude>**/version.txt</exclude>
				</excludes>
			</resource>
		</resources>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<configuration>
					<attach>true</attach>
					<descriptors>
						<descriptor>src/main/resources/distribution.xml</descriptor>
					</descriptors>
				</configuration>
				<executions>
					<execution>
						<id>create-archive</id>
						<!-- this is used for inheritance merges -->
						<phase>verify</phase>
						<!-- bind to the packaging phase -->
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>appassembler-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>assemble-standalone-windows</id>
						<phase>package</phase>
						<goals>
							<goal>assemble</goal>
						</goals>
						<configuration>
							<extraJvmArguments>-Djava.library.path=%USER_NATIVE_LIBRARIES_DIRECTORY%</extraJvmArguments>
							<programs>
								<program>
									<platforms>
										<platform>windows</platform>
									</platforms>
									<name>mixnet</name>
									<mainClass>com.scytl.products.ov.mixnet.Application</mainClass>
								</program>
							</programs>
							<repositoryLayout>flat</repositoryLayout>
							<repositoryName>lib</repositoryName>
							<configurationDirectory>properties</configurationDirectory>
							<binFileExtensions>
								<unix>.sh</unix>
							</binFileExtensions>
							<copyConfigurationDirectory>true</copyConfigurationDirectory>
							<configurationSourceDirectory>src/main/resources</configurationSourceDirectory>
						</configuration>
					</execution>
					<execution>
						<id>assemble-standalone-unix</id>
						<phase>package</phase>
						<goals>
							<goal>assemble</goal>
						</goals>
						<configuration>
							<extraJvmArguments>-Djava.library.path=$USER_NATIVE_LIBRARIES_DIRECTORY</extraJvmArguments>
							<programs>
								<program>
									<platforms>
										<platform>unix</platform>
									</platforms>
									<name>mixnet</name>
									<mainClass>com.scytl.products.ov.mixnet.Application</mainClass>
								</program>
							</programs>
							<repositoryLayout>flat</repositoryLayout>
							<repositoryName>lib</repositoryName>
							<configurationDirectory>properties</configurationDirectory>
							<binFileExtensions>
								<unix>.sh</unix>
							</binFileExtensions>
							<copyConfigurationDirectory>true</copyConfigurationDirectory>
							<configurationSourceDirectory>src/main/resources</configurationSourceDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-distribution</id>
						<phase>package</phase>
						<goals>
							<goal>attach-artifact</goal>
						</goals>
						<configuration>
							<artifacts>
								<artifact>
									<file>target/${project.artifactId}-${project.version}-distribution.zip</file>
									<type>zip</type>
								</artifact>
							</artifacts>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<configuration>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
			</plugin>
		</plugins>
	</build>
</project>
