<?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.portal.parent</artifactId>
		<version>4.1.0</version>
		<relativePath>../pom.xml</relativePath>
	</parent>
	<artifactId>com.liferay.faces.portal</artifactId>
	<name>Liferay Faces Portal</name>

	<properties>
		<bnd.version>4.1.0</bnd.version>
	</properties>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.4</version>
				<configuration>
					<useDefaultManifestFile>true</useDefaultManifestFile>
					<archive>
						<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
						<manifestEntries>
							<Built-By>Release Manager</Built-By>
							<Implementation-Title>${project.name}</Implementation-Title>
							<Implementation-Version>${full.version}</Implementation-Version>
							<Implementation-Vendor-Id>com.liferay</Implementation-Vendor-Id>
							<Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<groupId>biz.aQute.bnd</groupId>
				<artifactId>bnd-maven-plugin</artifactId>
				<version>${bnd.version}</version>
				<configuration>
					<bnd>
						<![CDATA[
							# Consult individual package-info.java files to determine Export-Packages and versions.
							-exportcontents: ${packages;VERSIONED}
							Export-Package: \
								com.liferay.faces.portal.context.internal,\
								com.liferay.faces.portal.el.internal,\
								com.liferay.faces.portal.render.internal,\
								com.liferay.faces.portal.component.inputrichtext.internal,\
								com.liferay.faces.portal.component.navbar.internal,\
								com.liferay.faces.portal.component.navbarsearch.internal,\
								com.liferay.faces.portal.component.runtime.internal,\
								com.liferay.faces.portal.component.inputsearch.internal,\
								com.liferay.faces.portal.component.captcha.internal,\
								com.liferay.faces.portal.component.permissionsurl.internal,\
								com.liferay.faces.portal.component.nav.internal,\
								com.liferay.faces.portal.component.navitem.internal,\
								com.liferay.faces.portal.component.header.internal,\
								com.liferay.faces.portal.resource.internal,\
								com.liferay.faces.portal.jsp.internal
							# javax.el is automatically imported with the following versions:
							# javax.el;version="[2.2.0,3.0.0)", but versions 3.0.0+ are also valid.
							Import-Package: \
								!com.liferay.faces.portal,\
								!com.liferay.faces.portal.*,\
								com.liferay.expando.kernel.model;version="1.0.0",\
								com.liferay.exportimport.kernel.lar;version="1.0.0",\
								com.liferay.portal.kernel.captcha;version="6.3.0",\
								com.liferay.portal.kernel.exception;version="7.0.0",\
								com.liferay.portal.kernel.model;version="1.0.0",\
								com.liferay.portal.kernel.portlet;version="7.1.0",\
								com.liferay.portal.kernel.repository.model;version="7.0.0",\
								com.liferay.portal.kernel.security.permission;version="1.0.0",\
								com.liferay.portal.kernel.service;version="1.2.0",\
								com.liferay.portal.kernel.service.permission;version="[1.0.0,3.0.0)",\
								com.liferay.portal.kernel.servlet;version="7.1.0",\
								com.liferay.portal.kernel.theme;version="1.0.0",\
								com.liferay.portal.kernel.trash;version="7.0.0",\
								com.liferay.portal.kernel.util;version="7.2.0",\
								com.liferay.taglib;version="7.0.0",\
								com.liferay.taglib.aui;version="7.1.0",\
								com.liferay.taglib.portletext;version="7.0.0",\
								com.liferay.taglib.security;version="7.0.0",\
								com.liferay.taglib.ui;version="7.1.0",\
								com.liferay.wiki.model;version="1.1.0",\
								javax.el;version="[2.2.0,4.0.0)",\
								javax.portlet;version="[2.0.0,4.0.0)",\
								*
						]]>
					</bnd>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>bnd-process</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>biz.aQute.bnd</groupId>
				<artifactId>bnd-baseline-maven-plugin</artifactId>
				<version>${bnd.version}</version>
				<configuration>
					<includeDistributionManagement>false</includeDistributionManagement>
					<fullReport>true</fullReport>
				</configuration>
				<executions>
					<execution>
						<id>baseline</id>
						<goals>
							<goal>baseline</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>net.alchim31.maven</groupId>
				<artifactId>yuicompressor-maven-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>compress</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<dependencies>
		<dependency>
			<groupId>javax.el</groupId>
			<artifactId>javax.el-api</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.faces</groupId>
			<artifactId>javax.faces-api</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.portlet</groupId>
			<artifactId>portlet-api</artifactId>
		</dependency>
		<!-- Note that javax.servlet-api is only necessary to make Eclipse happy -->
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
		</dependency>
		<!-- Note that jsp-api is only necessary to make Eclipse happy -->
		<dependency>
			<groupId>javax.servlet.jsp</groupId>
			<artifactId>javax.servlet.jsp-api</artifactId>
		</dependency>
		<dependency>
			<groupId>com.liferay</groupId>
			<artifactId>com.liferay.captcha.api</artifactId>
		</dependency>
		<dependency>
			<groupId>com.liferay</groupId>
			<artifactId>com.liferay.captcha.taglib</artifactId>
		</dependency>
		<dependency>
			<groupId>com.liferay</groupId>
			<artifactId>com.liferay.wiki.api</artifactId>
			<version>3.0.4</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.liferay.portal</groupId>
			<artifactId>com.liferay.portal.kernel</artifactId>
		</dependency>
		<dependency>
			<groupId>com.liferay.portal</groupId>
			<artifactId>com.liferay.util.taglib</artifactId>
		</dependency>
		<dependency>
			<groupId>com.liferay.faces</groupId>
			<artifactId>com.liferay.faces.util</artifactId>
		</dependency>
		<dependency>
			<groupId>org.osgi</groupId>
			<artifactId>org.osgi.core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.osgi</groupId>
			<artifactId>osgi.annotation</artifactId>
			<version>6.0.1</version>
			<scope>provided</scope>
			<optional>true</optional>
		</dependency>

		<!-- test dependencies -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
		</dependency>
		<dependency>
			<groupId>com.liferay</groupId>
			<artifactId>com.liferay.message.boards.parser.bbcode</artifactId>
			<version>3.0.0</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.liferay</groupId>
			<artifactId>com.liferay.petra.string</artifactId>
			<version>2.0.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.liferay</groupId>
			<artifactId>com.liferay.petra.lang</artifactId>
			<version>2.0.5</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.liferay</groupId>
			<artifactId>com.liferay.wiki.engine.creole</artifactId>
			<version>3.0.3</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>net.htmlparser.jericho</groupId>
			<artifactId>jericho-html</artifactId>
			<version>3.4</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.liferay.portal</groupId>
			<artifactId>com.liferay.portal.impl</artifactId>
			<version>2.39.0</version>
			<scope>test</scope>
		</dependency>
		<!-- test dependencies -->
	</dependencies>

	<profiles>
		<profile>
			<id>transform</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>xml-maven-plugin</artifactId>
						<version>1.0</version>
						<executions>
							<execution>
								<goals>
									<goal>transform</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<transformationSets>
								<transformationSet>
									<dir>${liferay.app.server.tld.portal.dir}</dir>
									<outputDir>${project.build.directory}/transform</outputDir>
									<includes>
										<include>liferay-ui.tld</include>
									</includes>
									<fileMappers>
										<fileMapper implementation="org.codehaus.plexus.components.io.filemappers.RegExpFileMapper">
											<pattern>.tld</pattern>
											<replacement>-ext.xml</replacement>
										</fileMapper>
									</fileMappers>
									<stylesheet>src/main/resources/META-INF/tld2taglib.xsl</stylesheet>
									<outputProperties>
										<outputProperty>
											<name>indent</name>
											<value>yes</value>
										</outputProperty>
									</outputProperties>
								</transformationSet>
								<transformationSet>
									<dir>${liferay.app.server.tld.portal.dir}</dir>
									<outputDir>${project.build.directory}/transform</outputDir>
									<includes>
										<include>liferay-ui.tld</include>
									</includes>
									<fileMappers>
										<fileMapper implementation="org.codehaus.plexus.components.io.filemappers.RegExpFileMapper">
											<pattern>.tld</pattern>
											<replacement>.java</replacement>
										</fileMapper>
									</fileMappers>
									<stylesheet>src/main/resources/META-INF/tld2java.xsl</stylesheet>
									<outputProperties>
										<outputProperty>
											<name>indent</name>
											<value>yes</value>
										</outputProperty>
									</outputProperties>
								</transformationSet>
							</transformationSets>
						</configuration>
						<dependencies>
							<dependency>
								<groupId>net.sf.saxon</groupId>
								<artifactId>saxon</artifactId>
								<version>8.7</version>
							</dependency>
						</dependencies>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>generate-components</id>
			<properties>
				<copyright.year>${maven.build.timestamp}</copyright.year>
				<maven.build.timestamp.format>yyyy</maven.build.timestamp.format>
			</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>portal-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}/portal-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.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>2.10.4</version>
						<executions>
							<execution>
								<goals>
									<goal>javadoc</goal>
								</goals>
								<phase>generate-resources</phase>
								<configuration>
									<destDir>${project.artifact.selectedVersion.majorVersion}.${project.artifact.selectedVersion.minorVersion}</destDir>
									<reportOutputDirectory>${project.build.directory}/javadoc/portal</reportOutputDirectory>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<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 Portal View Description Language Documentation (VDLDoc)</argument>
										<argument>-doctitle</argument>
										<argument>Liferay Faces Portal View Description Language Documentation (VDLDoc)</argument>
										<argument>-d</argument>
										<argument>${project.build.directory}/vdldoc/portal/${project.artifact.selectedVersion.majorVersion}.${project.artifact.selectedVersion.minorVersion}</argument>
										<argument>${project.basedir}/src/main/resources/META-INF/portal.taglib.xml</argument>
										<argument>${project.basedir}/src/main/resources/META-INF/liferay.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>
