<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Asset Share Commons
  ~
  ~ Copyright [2017]  Adobe
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<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>
	<!-- ====================================================================== -->
	<!-- P A R E N T P R O J E C T D E S C R I P T I O N -->
	<!-- ====================================================================== -->
	<parent>
		<groupId>com.adobe.aem.commons</groupId>
		<artifactId>assetshare</artifactId>
		<version>1.8.0</version>
	</parent>

	<!-- ====================================================================== -->
	<!-- P R O J E C T D E S C R I P T I O N -->
	<!-- ====================================================================== -->

	<artifactId>assetshare.ui.apps</artifactId>
	<packaging>content-package</packaging>
	<name>Asset Share Commons UI.Apps Package</name>
	<description>Asset Share Commons is an open-source asset share implementation for Adobe Experience Manager. This requires a minimum of AEM 6.3 SP1. </description>

	<dependencies>
		<dependency>
			<groupId>com.adobe.aem.commons</groupId>
			<artifactId>assetshare.core</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>org.osgi</groupId>
			<artifactId>org.osgi.core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.osgi</groupId>
			<artifactId>org.osgi.compendium</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-lang</groupId>
			<artifactId>commons-lang</artifactId>
		</dependency>
		<dependency>
			<groupId>com.day.commons</groupId>
			<artifactId>day-commons-jstl</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.servlet.jsp</groupId>
			<artifactId>jsp-api</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.jcr</groupId>
			<artifactId>jcr</artifactId>
		</dependency>
		<dependency>
			<groupId>com.day.cq.wcm</groupId>
			<artifactId>cq-wcm-taglib</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.sling</groupId>
			<artifactId>org.apache.sling.scripting.jsp.taglib</artifactId>
		</dependency>
		<dependency>
			<groupId>com.adobe.aem</groupId>
			<artifactId>uber-jar</artifactId>
			<classifier>apis</classifier>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-simple</artifactId>
		</dependency>
		<dependency>
			<groupId>com.adobe.cq</groupId>
			<artifactId>core.wcm.components.all</artifactId>
			<type>zip</type>
		</dependency>
	</dependencies>
	<build>
		<resources>
			<resource>
				<directory>src/main/content/jcr_root</directory>
				<filtering>false</filtering>
				<excludes>
					<exclude>**/.vlt</exclude>
					<exclude>**/.vltignore</exclude>
				</excludes>
			</resource>
			<resource>
				<directory>src/main/content/META-INF/vault/definition</directory>
				<targetPath>../vault-work/META-INF/vault/definition</targetPath>
			</resource>
		</resources>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<configuration>
					<includeEmptyDirs>true</includeEmptyDirs>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>jslint-maven-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>jslint</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<sourceJsFolder>src/main/content/jcr_root</sourceJsFolder>
					<failOnIssues>true</failOnIssues>
					<predefinedVars>jQuery,window,$,use,properties,pageProperties,inheritedPageProperties,component,componentContext,currentDesign,currentNode,currentPage,currentSession,currentStyle,designer,editContext,log,out,pageManager,reader,request,resource,resourceDesign,resourcePage,response,sling,slyWcmHelper,wcmmode,xssAPI,Bloodhound</predefinedVars>
					<excludes>
						<exclude>**/extensions/**/*.js</exclude>
						<exclude>**/vendor/**/*.js</exclude>
						<exclude>**/clientlib-theme/**/*.js</exclude>
					</excludes>
				</configuration>
			</plugin>

			<plugin>
				<groupId>com.day.jcr.vault</groupId>
				<artifactId>content-package-maven-plugin</artifactId>
				<extensions>true</extensions>
				<configuration>
					<name>asset-share-commons.ui.apps</name>
					<group>asset-share-commons</group>
					<finalName>asset-share-commons.ui.apps-${project.version}</finalName>
					<filterSource>src/main/content/META-INF/vault/filter.xml</filterSource>
					<properties>
						<acHandling>merge_preserve</acHandling>
						<dependencies>
							<!--adobe/cq630/servicepack:aem-service-pkg:6.3.1-->
						</dependencies>
					</properties>
					<embeddeds>
						<embedded>
							<artifactId>assetshare.core</artifactId>
							<target>/apps/asset-share-commons/install</target>
						</embedded>
					</embeddeds>
					<subPackages>
						<subPackage>
							<groupId>com.adobe.cq</groupId>
							<artifactId>core.wcm.components.all</artifactId>
							<filter>true</filter>
						</subPackage>
					</subPackages>
					<targetURL>http://${crx.host}:${crx.port}/crx/packmgr/service.jsp</targetURL>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.sling</groupId>
				<artifactId>htl-maven-plugin</artifactId>
				<version>1.0.6</version>
				<configuration>
					<sourceDirectory>${basedir}/src/main/content/jcr_root</sourceDirectory>
					<failOnWarnings>true</failOnWarnings>
				</configuration>
				<executions>
					<execution>
						<id>validate-scripts</id>
						<goals>
							<goal>validate</goal>
						</goals>
						<phase>compile</phase>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
	<profiles>
		<profile>
			<id>autoInstallPackage</id>
			<build>
				<plugins>
					<plugin>
						<groupId>com.day.jcr.vault</groupId>
						<artifactId>content-package-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>install-content-package</id>
								<phase>install</phase>
								<goals>
									<goal>install</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>autoInstallPackagePublish</id>
			<build>
				<plugins>
					<plugin>
						<groupId>com.day.jcr.vault</groupId>
						<artifactId>content-package-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>install-content-package-publish</id>
								<phase>install</phase>
								<goals>
									<goal>install</goal>
								</goals>
								<configuration>
									<targetURL>http://${publish.crx.host}:${publish.crx.port}/crx/packmgr/service.jsp</targetURL>
									<userId>${publish.crx.username}</userId>
									<password>${publish.crx.password}</password>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>autoInstallPackage-all</id>
			<build>
				<plugins>
					<plugin>
						<groupId>com.day.jcr.vault</groupId>
						<artifactId>content-package-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>install-content-package</id>
								<phase>install</phase>
								<goals>
									<goal>install</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>autoInstallPackagePublish-all</id>
			<build>
				<plugins>
					<plugin>
						<groupId>com.day.jcr.vault</groupId>
						<artifactId>content-package-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>install-content-package-publish</id>
								<phase>install</phase>
								<goals>
									<goal>install</goal>
								</goals>
								<configuration>
									<targetURL>http://${publish.crx.host}:${publish.crx.port}/crx/packmgr/service.jsp</targetURL>
									<userId>${publish.crx.username}</userId>
									<password>${publish.crx.password}</password>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
