<?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.alloy.parent</artifactId>
		<version>4.1.1</version>
	</parent>
	<artifactId>com.liferay.faces.alloy</artifactId>
	<name>Liferay Faces Alloy</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.alloy.application.internal,\
								com.liferay.faces.alloy.component.accordion.internal,\
								com.liferay.faces.alloy.component.audio.internal,\
								com.liferay.faces.alloy.component.autocomplete.internal,\
								com.liferay.faces.alloy.component.body.internal,\
								com.liferay.faces.alloy.component.button.internal,\
								com.liferay.faces.alloy.component.buttonrow.internal,\
								com.liferay.faces.alloy.component.column.internal,\
								com.liferay.faces.alloy.component.commandbutton.internal,\
								com.liferay.faces.alloy.component.commandlink.internal,\
								com.liferay.faces.alloy.component.data.internal,\
								com.liferay.faces.alloy.component.dataitem.internal,\
								com.liferay.faces.alloy.component.datalist.internal,\
								com.liferay.faces.alloy.component.datatable.internal,\
								com.liferay.faces.alloy.component.dialog.internal,\
								com.liferay.faces.alloy.component.field.internal,\
								com.liferay.faces.alloy.component.fieldset.internal,\
								com.liferay.faces.alloy.component.form.internal,\
								com.liferay.faces.alloy.component.head.internal,\
								com.liferay.faces.alloy.component.icon.internal,\
								com.liferay.faces.alloy.component.image.internal,\
								com.liferay.faces.alloy.component.inputdate.internal,\
								com.liferay.faces.alloy.component.inputdatetime.internal,\
								com.liferay.faces.alloy.component.inputfile.internal,\
								com.liferay.faces.alloy.component.inputhidden.internal,\
								com.liferay.faces.alloy.component.inputsecret.internal,\
								com.liferay.faces.alloy.component.inputsourcecode.internal,\
								com.liferay.faces.alloy.component.inputtext.internal,\
								com.liferay.faces.alloy.component.inputtextarea.internal,\
								com.liferay.faces.alloy.component.inputtime.internal,\
								com.liferay.faces.alloy.component.link.internal,\
								com.liferay.faces.alloy.component.media.internal,\
								com.liferay.faces.alloy.component.message.internal,\
								com.liferay.faces.alloy.component.messages.internal,\
								com.liferay.faces.alloy.component.nodemenunav.internal,\
								com.liferay.faces.alloy.component.outputformat.internal,\
								com.liferay.faces.alloy.component.outputlabel.internal,\
								com.liferay.faces.alloy.component.outputlink.internal,\
								com.liferay.faces.alloy.component.outputremainingchars.internal,\
								com.liferay.faces.alloy.component.outputscript.internal,\
								com.liferay.faces.alloy.component.outputscriptstylesheet.internal,\
								com.liferay.faces.alloy.component.outputstylesheet.internal,\
								com.liferay.faces.alloy.component.outputtext.internal,\
								com.liferay.faces.alloy.component.outputtooltip.internal,\
								com.liferay.faces.alloy.component.overlay.internal,\
								com.liferay.faces.alloy.component.paginator.internal,\
								com.liferay.faces.alloy.component.panel.internal,\
								com.liferay.faces.alloy.component.panelgrid.internal,\
								com.liferay.faces.alloy.component.panelgroup.internal,\
								com.liferay.faces.alloy.component.popover.internal,\
								com.liferay.faces.alloy.component.progressbar.internal,\
								com.liferay.faces.alloy.component.row.internal,\
								com.liferay.faces.alloy.component.select.internal,\
								com.liferay.faces.alloy.component.selectbooleancheckbox.internal,\
								com.liferay.faces.alloy.component.selectmanycheckbox.internal,\
								com.liferay.faces.alloy.component.selectmanylistbox.internal,\
								com.liferay.faces.alloy.component.selectmanymenu.internal,\
								com.liferay.faces.alloy.component.selectonelistbox.internal,\
								com.liferay.faces.alloy.component.selectonemenu.internal,\
								com.liferay.faces.alloy.component.selectoneradio.internal,\
								com.liferay.faces.alloy.component.selectrating.internal,\
								com.liferay.faces.alloy.component.selectstarrating.internal,\
								com.liferay.faces.alloy.component.selectthumbrating.internal,\
								com.liferay.faces.alloy.component.tab.internal,\
								com.liferay.faces.alloy.component.tabview.internal,\
								com.liferay.faces.alloy.component.video.internal,\
								com.liferay.faces.alloy.config.internal,\
								com.liferay.faces.alloy.event.internal,\
								com.liferay.faces.alloy.i18n.internal,\
								com.liferay.faces.alloy.render.internal,\
								com.liferay.faces.alloy.tagdecorator.internal,\
								com.liferay.faces.alloy.util.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.alloy,\
								!com.liferay.faces.alloy.*,\
								com.liferay.faces.util.*;version="[3.0.0,5.0.0)",\
								javax.el;version="[2.2.0,4.0.0)",\
								org.apache.commons.io;resolution:=optional,\
								*
						]]>
					</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>
				<artifactId>maven-antrun-plugin</artifactId>
				<executions>
					<execution>
						<phase>process-resources</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<target>
								<copy file="${basedir}/../reslib/target/classes/META-INF/yui3-bsd-license.txt" tofile="${project.build.directory}/classes/META-INF/resources/liferay-faces-alloy/yui/yui3-bsd-license.txt" />
								<copy file="${basedir}/../reslib/target/classes/META-INF/resources/liferay-faces-alloy-reslib/build/text-data-wordbreak/text-data-wordbreak.js" tofile="${project.build.directory}/classes/META-INF/resources/liferay-faces-alloy/yui/autocomplete/text-data-wordbreak.js" />
								<copy file="${basedir}/../reslib/target/classes/META-INF/alloyui-bsd-license.md" tofile="${project.build.directory}/classes/META-INF/resources/liferay-faces-alloy/aui/alloyui-bsd-license.md" />
							</target>
						</configuration>
					</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>
		<!-- BEGIN: Only required for file upload -->
		<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 file upload -->
		<dependency>
			<groupId>org.osgi</groupId>
			<artifactId>osgi.annotation</artifactId>
			<version>6.0.1</version>
			<scope>provided</scope>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>${faces.impl.group.id}</groupId>
			<artifactId>${faces.impl.artifact.id}</artifactId>
			<scope>test</scope>
		</dependency>
		<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.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.servlet.jsp</groupId>
			<artifactId>javax.servlet.jsp-api</artifactId>
		</dependency>
		<dependency>
			<groupId>com.liferay.faces</groupId>
			<artifactId>com.liferay.faces.util</artifactId>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<profiles>
		<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>alloy-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}/alloy-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/alloy</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 Alloy View Description Language Documentation (VDLDoc)</argument>
										<argument>-doctitle</argument>
										<argument>Liferay Faces Alloy View Description Language Documentation (VDLDoc)</argument>
										<argument>-d</argument>
										<argument>${project.build.directory}/vdldoc/alloy/${project.artifact.selectedVersion.majorVersion}.${project.artifact.selectedVersion.minorVersion}</argument>
										<argument>${project.basedir}/src/main/resources/META-INF/alloy.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>
