<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>com.liferay.faces.demo</groupId>
		<artifactId>com.liferay.faces.demo.showcase.parent</artifactId>
		<version>3.0.5</version>
		<relativePath>../pom.xml</relativePath>
	</parent>
	<artifactId>com.liferay.faces.demo.jsf.showcase.webapp</artifactId>
	<packaging>war</packaging>
	<name>JSF Showcase Webapp</name>
	<description>This plugin is the JSF Showcase demo webapp.</description>

	<profiles>
		<profile>
			<id>jdkNotSupportedBySelenium</id>
			<activation>
				<jdk>(,1.6]</jdk>
			</activation>
			<properties>
				<maven.test.skip>true</maven.test.skip>
			</properties>
		</profile>
		<profile>
			<id>prettyfaces</id>
			<dependencies>
				<dependency>
					<groupId>com.ocpsoft</groupId>
					<artifactId>prettyfaces-jsf2</artifactId>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>firefox</id>
			<properties>
				<integration.browser.name>firefox</integration.browser.name>
			</properties>
			<dependencies>
				<dependency>
					<groupId>org.seleniumhq.selenium</groupId>
					<artifactId>selenium-firefox-driver</artifactId>
					<version>2.53.0</version>
					<scope>test</scope>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>phantomjs</id>
			<properties>
				<integration.browser.name>phantomjs</integration.browser.name>
			</properties>
			<dependencies>
				<dependency>
					<groupId>com.codeborne</groupId>
					<artifactId>phantomjsdriver</artifactId>
					<version>1.3.0</version>
					<scope>test</scope>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>htmlunit</id>
			<properties>
				<integration.browser.name>htmlunit</integration.browser.name>
			</properties>
			<dependencies>
				<dependency>
					<groupId>org.seleniumhq.selenium</groupId>
					<artifactId>htmlunit-driver</artifactId>
					<version>2.23.2</version>
					<scope>test</scope>
				</dependency>
				<dependency>
					<groupId>xml-apis</groupId>
					<artifactId>xml-apis</artifactId>
					<version>1.4.01</version>
					<scope>test</scope>
				</dependency>
				<dependency>
					<groupId>org.eclipse.jetty.websocket</groupId>
					<artifactId>websocket-client</artifactId>
					<version>9.2.18.v20160721</version>
					<scope>test</scope>
				</dependency>
				<dependency>
					<groupId>org.apache.httpcomponents</groupId>
					<artifactId>httpclient</artifactId>
					<version>4.5.2</version>
					<scope>test</scope>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>jbrowser</id>
			<properties>
				<integration.browser.name>jbrowser</integration.browser.name>
			</properties>
			<dependencies>
				<dependency>
					<groupId>com.machinepublishers</groupId>
					<artifactId>jbrowserdriver</artifactId>
					<version>0.17.3</version>
					<scope>test</scope>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>selenium</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-failsafe-plugin</artifactId>
						<version>2.19.1</version>
						<executions>
							<execution>
								<id>selenium-tests</id>
								<goals>
									<goal>integration-test</goal>
									<goal>verify</goal>
								</goals>
								<configuration>
									<systemPropertyVariables>
										<RUNNING_WITH_MAVEN>true</RUNNING_WITH_MAVEN>
										<!-- Specify a property like so: -Dintegration.browser.name=phantomjs -->
										<integration.browser.name>${integration.browser.name}</integration.browser.name>
										<integration.browser.headless>${integration.browser.headless}</integration.browser.headless>
										<integration.browser.simulate.mobile>${integration.browser.simulate.mobile}</integration.browser.simulate.mobile>
										<integration.browser.driver.wait.time.out>${integration.browser.driver.wait.time.out}</integration.browser.driver.wait.time.out>
										<integration.container>tomcat</integration.container>
										<integration.protocol>${integration.protocol}</integration.protocol>
										<integration.host>${integration.host}</integration.host>
										<integration.port>${integration.port}</integration.port>
										<integration.showcase.context>/com.liferay.faces.demo.jsf.showcase.webapp/web/guest/showcase/-/component</integration.showcase.context>
										<integration.default.component.prefix>h</integration.default.component.prefix>
										<integration.sign.in.context>${integration.sign.in.context}</integration.sign.in.context>
										<integration.login.xpath>${integration.login.xpath}</integration.login.xpath>
										<integration.password.xpath>${integration.password.xpath}</integration.password.xpath>
										<integration.sign.in.button.xpath>${integration.sign.in.button.xpath}</integration.sign.in.button.xpath>
										<integration.login>${integration.login}</integration.login>
										<integration.password>${integration.password}</integration.password>
									</systemPropertyVariables>
									<properties>
										<property>
											<name>listener</name>
											<value>com.liferay.faces.test.selenium.browser.BrowserDriverManagingTestSuiteListener</value>
										</property>
									</properties>
									<includes>
										<include>**/*Test.java,**/Test*.java,**/*TestCase.java,**/*Tester.java</include>
									</includes>
									<trimStackTrace>false</trimStackTrace>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.0.2</version>
				<executions>
					<execution>
						<goals>
							<goal>test-jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-install-plugin</artifactId>
				<configuration>
					<skip>false</skip>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.7</version>
				<executions>
					<execution>
						<id>process-test-resources</id>
						<phase>process-test-resources</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<target>
								<copy file="src/main/webapp/WEB-INF/component/h/body/general/webappBody.xhtml" todir="${project.build.testOutputDirectory}" />
								<copy file="src/main/webapp/WEB-INF/component/h/body/general/portletBody.xhtml" todir="${project.build.testOutputDirectory}" />
								<copy file="src/main/webapp/WEB-INF/component/h/head/general/webappHead.xhtml" todir="${project.build.testOutputDirectory}" />
								<copy file="src/main/webapp/WEB-INF/component/h/head/general/portletHead.xhtml" todir="${project.build.testOutputDirectory}" />
							</target>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<resources>
			<resource>
				<directory>src/main/java</directory>
				<includes>
					<include>**/*.java</include>
				</includes>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
				<includes>
					<include>**/*.properties</include>
					<include>**/*.xml</include>
				</includes>
			</resource>
		</resources>
	</build>

	<dependencies>

		<!-- Integration test dependencies. -->
		<dependency>
			<groupId>com.liferay.faces.test</groupId>
			<artifactId>com.liferay.faces.test.selenium</artifactId>
			<version>0.5.4</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
			<version>1.7.25</version>
			<scope>test</scope>
		</dependency>
		<!-- End integration test dependencies. -->
		<dependency>
			<groupId>javax.annotation</groupId>
			<artifactId>javax.annotation-api</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.el</groupId>
			<artifactId>javax.el-api</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.faces</groupId>
			<artifactId>javax.faces-api</artifactId>
			<version>${faces.api.version}</version>
			<scope>${faces.api.scope}</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
		</dependency>
		<dependency>
			<groupId>com.liferay.faces.demo</groupId>
			<artifactId>com.liferay.faces.demo.showcase.common</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.validation</groupId>
			<artifactId>validation-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.hibernate.validator</groupId>
			<artifactId>hibernate-validator</artifactId>
		</dependency>
		<dependency>
			<groupId>org.glassfish.web</groupId>
			<artifactId>jstl-impl</artifactId>
		</dependency>
	</dependencies>

</project>
