<?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</groupId>
		<artifactId>com.liferay.faces.bridge.impl.parent</artifactId>
		<version>4.1.4</version>
		<relativePath>../pom.xml</relativePath>
	</parent>
	<artifactId>com.liferay.faces.bridge.impl</artifactId>
	<name>Liferay Faces Bridge Implementation</name>
	<description>Implementation of the API for Liferay Faces Bridge</description>

	<dependencies>
		<!-- BEGIN: Only required for bridge:inputFile -->
		<dependency>
			<groupId>commons-fileupload</groupId>
			<artifactId>commons-fileupload</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<optional>true</optional>
		</dependency>
		<!-- END: Only required for bridge:inputFile -->
		<dependency>
			<groupId>com.liferay.faces</groupId>
			<artifactId>com.liferay.faces.bridge.api</artifactId>
		</dependency>
		<dependency>
			<groupId>com.liferay.faces</groupId>
			<artifactId>com.liferay.faces.util</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.el</groupId>
			<artifactId>javax.el-api</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.enterprise</groupId>
			<artifactId>cdi-api</artifactId>
			<optional>true</optional>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.faces</groupId>
			<artifactId>javax.faces-api</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.portlet</groupId>
			<artifactId>portlet-api</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.servlet.jsp</groupId>
			<artifactId>javax.servlet.jsp-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.icefaces</groupId>
			<artifactId>icefaces-ace</artifactId>
			<scope>provided</scope>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<profiles>
		<profile>
			<!--
				Note: When the generating the bridge components, the API classes will be output into
				target/liferay-faces-bridge-api.
			-->
			<id>generate-components</id>
			<properties>
				<copyright.year>${maven.build.timestamp}</copyright.year>
				<maven.build.timestamp.format>yyyy</maven.build.timestamp.format>
				<!--
					To generate the portlet components run:

						mvn generate-sources -P generate-components -Dshort.namespace=portlet
				-->
				<short.namespace>bridge</short.namespace>
			</properties>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-resources-plugin</artifactId>
						<version>2.7</version>
						<executions>
							<execution>
								<id>copy-resources</id>
								<goals>
									<goal>copy-resources</goal>
								</goals>
								<phase>initialize</phase>
								<configuration>
									<outputDirectory>${project.build.directory}</outputDirectory>
									<resources>
										<resource>
											<directory>${project.basedir}</directory>
											<includes>
												<include>${short.namespace}-tags.xml</include>
											</includes>
											<filtering>true</filtering>
										</resource>
									</resources>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>exec-maven-plugin</artifactId>
						<version>1.2.1</version>
						<executions>
							<execution>
								<goals>
									<goal>java</goal>
								</goals>
								<phase>generate-sources</phase>
								<configuration>
									<includeProjectDependencies>false</includeProjectDependencies>
									<includePluginDependencies>true</includePluginDependencies>
									<mainClass>com.liferay.faces.generator.Generator</mainClass>
									<arguments>
										<argument>${project.build.directory}/${short.namespace}-tags.xml</argument>
									</arguments>
									<executableDependency>
										<groupId>com.liferay.faces</groupId>
										<artifactId>com.liferay.faces.generator</artifactId>
									</executableDependency>
								</configuration>
							</execution>
						</executions>
						<dependencies>
							<dependency>
								<groupId>com.liferay.faces</groupId>
								<artifactId>com.liferay.faces.generator</artifactId>
								<version>1.1.1</version>
							</dependency>
						</dependencies>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>generate-docs</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>exec-maven-plugin</artifactId>
						<version>1.5.0</version>
						<executions>
							<execution>
								<goals>
									<goal>java</goal>
								</goals>
								<phase>generate-resources</phase>
								<configuration>
									<includePluginDependencies>true</includePluginDependencies>
									<mainClass>org.omnifaces.vdldoc.Main</mainClass>
									<arguments>
										<argument>-windowtitle</argument>
										<argument>Liferay Faces Bridge View Description Language Documentation (VDLDoc)</argument>
										<argument>-doctitle</argument>
										<argument>Liferay Faces Bridge View Description Language Documentation (VDLDoc)</argument>
										<argument>-d</argument>
										<argument>${project.build.directory}/vdldoc/bridge-api/${project.artifact.selectedVersion.majorVersion}.${project.artifact.selectedVersion.minorVersion}</argument>
										<argument>${project.basedir}/src/main/resources/META-INF/bridge.taglib.xml</argument>
										<argument>${project.basedir}/src/main/resources/META-INF/portlet.taglib.xml</argument>
									</arguments>
									<executableDependency>
										<groupId>org.omnifaces</groupId>
										<artifactId>vdldoc</artifactId>
									</executableDependency>
								</configuration>
							</execution>
						</executions>
						<dependencies>
							<dependency>
								<groupId>org.omnifaces</groupId>
								<artifactId>vdldoc</artifactId>
								<version>2.1</version>
							</dependency>
						</dependencies>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>
