<?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.alloy.parent</artifactId>
		<version>3.0.3</version>
		<relativePath>../pom.xml</relativePath>
	</parent>
	<artifactId>com.liferay.faces.demo.alloy.showcase.webapp</artifactId>
	<packaging>war</packaging>
	<name>Alloy Showcase Webapp</name>
	<description>This plugin is the Liferay Faces Alloy Showcase demo webapp.</description>

	<properties>
		<integration.container>webapp</integration.container>
		<allow.casual.multipart.parsing>false</allow.casual.multipart.parsing>
		<maven.test.skip>true</maven.test.skip>
		<liferay.faces.showcase.war.scope>compile</liferay.faces.showcase.war.scope>
	</properties>

	<profiles>
		<profile>
			<id>prettyfaces</id>
			<properties>
				<allow.casual.multipart.parsing>true</allow.casual.multipart.parsing>
			</properties>
			<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>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>phantomjs</id>
			<properties>
				<integration.browser.name>phantomjs</integration.browser.name>
			</properties>
		</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>
			<properties>
				<maven.test.skip>false</maven.test.skip>
				<!-- Skip war overlay when testing. -->
				<liferay.faces.showcase.war.scope>provided</liferay.faces.showcase.war.scope>
			</properties>
			<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 -->
										<!--
											When running tests from an IDE (like eclipse), you may need to set certain system
											properties:

											-Dintegration.context=/com.liferay.faces.demo.alloy.showcase.webapp/web/guest/showcase/-/component
											-Dintegration.default.component.prefix=alloy

											Setting system properties in Eclipse:
											http://stackoverflow.com/questions/862391/how-to-pass-the-d-system-properties-while-testing-on-eclipse
											Setting systen properties in IntelliJ:
											http://stackoverflow.com/questions/29454494/set-java-system-properties-in-intellij-or-eclipse
											It is not necessary to set system properties in Netbeans since Netbeans
											automatically uses Maven properties correctly.
										-->
										<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>${integration.container}</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.alloy.showcase.webapp/web/guest/showcase/-/component</integration.showcase.context>
										<integration.default.component.prefix>alloy</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>
									<dependenciesToScan>
										<dependency>com.liferay.faces.demo:com.liferay.faces.demo.jsf.showcase.webapp</dependency>
									</dependenciesToScan>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
			<dependencies>
				<dependency>
					<groupId>com.liferay.faces.demo</groupId>
					<artifactId>com.liferay.faces.demo.jsf.showcase.webapp</artifactId>
					<version>${liferay.faces.showcase.version}</version>
					<type>test-jar</type>
					<scope>test</scope>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>release</id>
			<properties>
				<maven.test.skip>false</maven.test.skip>
			</properties>
			<dependencies>
				<dependency>
					<groupId>com.liferay.faces.demo</groupId>
					<artifactId>com.liferay.faces.demo.jsf.showcase.webapp</artifactId>
					<version>${liferay.faces.showcase.version}</version>
					<type>test-jar</type>
					<scope>test</scope>
				</dependency>
			</dependencies>
		</profile>
	</profiles>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.1.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>
				<artifactId>maven-war-plugin</artifactId>
				<configuration>
					<dependentWarExcludes>**/h-tags*,**/component/h/**/*,**/images/jsf*.png,WEB-INF/lib/*</dependentWarExcludes>
					<filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
					<webResources>
						<resource>
							<directory>src/main/webapp/META-INF</directory>
							<targetPath>/META-INF</targetPath>
							<filtering>true</filtering>
						</resource>
					</webResources>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.appfuse.plugins</groupId>
				<artifactId>maven-warpath-plugin</artifactId>
				<extensions>true</extensions>
				<executions>
					<execution>
						<goals>
							<goal>add-classes</goal>
						</goals>
					</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>
		<dependency>
			<groupId>com.liferay.faces</groupId>
			<artifactId>com.liferay.faces.alloy</artifactId>
			<version>${project.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>com.liferay.faces</groupId>
			<artifactId>com.liferay.faces.alloy.reslib</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>com.liferay.faces.demo</groupId>
			<artifactId>com.liferay.faces.demo.showcase.common</artifactId>
			<version>${liferay.faces.showcase.version}</version>
		</dependency>
		<dependency>
			<groupId>com.liferay.faces.demo</groupId>
			<artifactId>com.liferay.faces.demo.jsf.showcase.webapp</artifactId>
			<version>${liferay.faces.showcase.version}</version>
			<type>war</type>
			<scope>${liferay.faces.showcase.war.scope}</scope>
			<exclusions>
				<exclusion>
					<groupId>commons-fileupload</groupId>
					<artifactId>commons-fileupload</artifactId>
				</exclusion>
				<exclusion>
					<groupId>commons-io</groupId>
					<artifactId>commons-io</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>com.liferay.faces.demo</groupId>
			<artifactId>com.liferay.faces.demo.jsf.showcase.webapp</artifactId>
			<version>${liferay.faces.showcase.version}</version>
			<type>warpath</type>
		</dependency>

		<!-- Begin Selenium 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 Selenium Test Dependencies -->
	</dependencies>

</project>
