<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>es.uvigo.esei.xcs</groupId>
		<artifactId>sample</artifactId>
		<version>0.0.1-SNAPSHOT</version>
	</parent>
	<artifactId>jsf</artifactId>
	<packaging>war</packaging>

	<name>JSF</name>
	<description>XCS Sample - JSF</description>

	<dependencies>
		<!-- General -->
		<dependency>
			<groupId>javax</groupId>
			<artifactId>javaee-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>es.uvigo.esei.xcs</groupId>
			<artifactId>service</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
		    <groupId>org.webjars</groupId>
		    <artifactId>bootstrap</artifactId>
		</dependency>

		<!-- Testing -->
		<dependency>
			<groupId>es.uvigo.esei.xcs</groupId>
			<artifactId>tests</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.easymock</groupId>
			<artifactId>easymock</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.jboss.arquillian.junit</groupId>
			<artifactId>arquillian-junit-container</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.jboss.arquillian.extension</groupId>
			<artifactId>arquillian-persistence-dbunit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.jboss.arquillian.graphene</groupId>
			<artifactId>graphene-webdriver</artifactId>
			<type>pom</type>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.jboss.shrinkwrap.resolver</groupId>
			<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>
	
	<build>
		<plugins>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<skipTests>true</skipTests>
				</configuration>
			</plugin>
		</plugins>
	</build>
	
	<profiles>
		<profile>
			<id>jsf-geckodriver-download-unix</id>
			<activation>
				<os><family>unix</family></os>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<executions>
							<execution>
								<id>download-geckodriver</id>
								<phase>process-test-resources</phase>
								<configuration>
									<target>
										<mkdir dir="${geckodriver.basepath}"/>
										<get src="${geckodriver.url}" dest="${geckodriver.compressed.path}" skipexisting="true"/>
										<untar src="${geckodriver.compressed.path}" dest="${geckodriver.basepath}" compression="gzip"/>
										<chmod file="${geckodriver.uncompressed.path}" perm="a+x"/>
									</target>
								</configuration>
								<goals>
									<goal>run</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<systemPropertyVariables>
								<webdriver.gecko.driver>${geckodriver.uncompressed.path}</webdriver.gecko.driver>
							</systemPropertyVariables>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>jsf-geckodriver-download-windows</id>
			<activation>
				<os><family>windows</family></os>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<executions>
							<execution>
								<id>download-geckodriver</id>
								<phase>process-test-resources</phase>
								<configuration>
									<target>
										<mkdir dir="${geckodriver.basepath}"/>
										<get src="${geckodriver.url}" dest="${geckodriver.compressed.path}" skipexisting="true"/>
										<unzip src="${geckodriver.compressed.path}" dest="${geckodriver.basepath}"/>
										<chmod file="${geckodriver.uncompressed.path}" perm="a+x"/>
									</target>
								</configuration>
								<goals>
									<goal>run</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<systemPropertyVariables>
								<webdriver.gecko.driver>${geckodriver.uncompressed.path}</webdriver.gecko.driver>
							</systemPropertyVariables>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>jsf-geckodriver-properties-unix-amd64</id>
			<activation>
				<os>
					<family>unix</family>
					<arch>amd64</arch>
				</os>
			</activation>
			<properties>
				<geckodriver.url>https://github.com/mozilla/geckodriver/releases/download/${geckodriver.version}/geckodriver-${geckodriver.version}-linux64.tar.gz</geckodriver.url>
				<geckodriver.basepath>${project.build.directory}${file.separator}geckodriver</geckodriver.basepath>
				<geckodriver.compressed.path>${geckodriver.basepath}${file.separator}geckodriver-${geckodriver.version}-linux64.tar.gz</geckodriver.compressed.path>
				<geckodriver.uncompressed.path>${geckodriver.basepath}${file.separator}geckodriver</geckodriver.uncompressed.path>
			</properties>
		</profile>
		<profile>
			<id>jsf-geckodriver-properties-unix-x86</id>
			<activation>
				<os>
					<family>unix</family>
					<arch>x86</arch>
				</os>
			</activation>
			<properties>
				<geckodriver.url>https://github.com/mozilla/geckodriver/releases/download/${geckodriver.version}/geckodriver-${geckodriver.version}-linux86.tar.gz</geckodriver.url>
				<geckodriver.basepath>${project.build.directory}${file.separator}geckodriver</geckodriver.basepath>
				<geckodriver.compressed.path>${geckodriver.basepath}${file.separator}geckodriver-${geckodriver.version}-linux86.tar.gz</geckodriver.compressed.path>
				<geckodriver.uncompressed.path>${geckodriver.basepath}${file.separator}geckodriver</geckodriver.uncompressed.path>
			</properties>
		</profile>
		<profile>
			<id>jsf-geckodriver-properties-windows-amd64</id>
			<activation>
				<os>
					<family>windows</family>
					<arch>amd64</arch>
				</os>
			</activation>
			<properties>
				<geckodriver.url>https://github.com/mozilla/geckodriver/releases/download/${geckodriver.version}/geckodriver-${geckodriver.version}-win64.zip</geckodriver.url>
				<geckodriver.basepath>${project.build.directory}${file.separator}geckodriver</geckodriver.basepath>
				<geckodriver.compressed.path>${geckodriver.basepath}${file.separator}geckodriver-${geckodriver.version}-win64.zip</geckodriver.compressed.path>
				<geckodriver.uncompressed.path>${geckodriver.basepath}${file.separator}geckodriver.exe</geckodriver.uncompressed.path>
			</properties>
		</profile>
		<profile>
			<id>jsf-geckodriver-properties-windows-x86</id>
			<activation>
				<os>
					<family>windows</family>
					<arch>x86</arch>
				</os>
			</activation>
			<properties>
				<geckodriver.url>https://github.com/mozilla/geckodriver/releases/download/${geckodriver.version}/geckodriver-${geckodriver.version}-win86.zip</geckodriver.url>
				<geckodriver.basepath>${project.build.directory}${file.separator}geckodriver</geckodriver.basepath>
				<geckodriver.compressed.path>${geckodriver.basepath}${file.separator}geckodriver-${geckodriver.version}-win86.zip</geckodriver.compressed.path>
				<geckodriver.uncompressed.path>${geckodriver.basepath}${file.separator}geckodriver.exe</geckodriver.uncompressed.path>
			</properties>
		</profile>
		<profile>
			<id>jsf-geckodriver-properties-and-download-mac</id>
			<activation>
				<os>
					<family>mac</family>
				</os>
			</activation>
			<properties>
				<geckodriver.url>https://github.com/mozilla/geckodriver/releases/download/${geckodriver.version}/geckodriver-${geckodriver.version}-macos.tar.gz</geckodriver.url>
				<geckodriver.basepath>${project.build.directory}${file.separator}geckodriver</geckodriver.basepath>
				<geckodriver.compressed.path>${geckodriver.basepath}${file.separator}geckodriver-${geckodriver.version}-macos.tar.gz</geckodriver.compressed.path>
				<geckodriver.uncompressed.path>${geckodriver.basepath}${file.separator}geckodriver</geckodriver.uncompressed.path>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<executions>
							<execution>
								<id>download-geckodriver</id>
								<phase>process-test-resources</phase>
								<configuration>
									<target>
										<mkdir dir="${geckodriver.basepath}"/>
										<get src="${geckodriver.url}" dest="${geckodriver.compressed.path}" skipexisting="true"/>
										<untar src="${geckodriver.compressed.path}" dest="${geckodriver.basepath}" compression="gzip"/>
										<chmod file="${geckodriver.uncompressed.path}" perm="a+x"/>
									</target>
								</configuration>
								<goals>
									<goal>run</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<systemPropertyVariables>
								<webdriver.gecko.driver>${geckodriver.uncompressed.path}</webdriver.gecko.driver>
							</systemPropertyVariables>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>