<?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/xsd/maven-4.0.0.xsd">

	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>com.atlassian.rm</groupId>
		<artifactId>common</artifactId>
		<version>1001.8.0-D20170411T094411</version>
		<relativePath>../pom.xml</relativePath>
	</parent>

	<artifactId>common-dev-server</artifactId>

	<name>Portfolio 2 / Common [Dev Server]</name>

	<dependencies>

		<dependency>
			<groupId>com.atlassian.rm</groupId>
			<artifactId>common-client</artifactId>
			<version>${project.version}</version>
			<type>pom</type>
		</dependency>

		<dependency>
			<groupId>com.atlassian.rm</groupId>
			<artifactId>portfolio-client</artifactId>
			<version>${project.version}</version>
			<type>pom</type>
		</dependency>

	</dependencies>

	<profiles>

		<profile>

			<id>client-build</id>
			<activation>
				<property>
					<name>!skipClient</name>
				</property>
			</activation>

			<build>

				<plugins>

					<plugin>

						<artifactId>maven-clean-plugin</artifactId>

						<configuration>
							<filesets combine.children="append">
								<fileset>
									<directory>src/main/resources</directory>
									<includes>
										<include>i18n/</include>
										<include>i18n-common/</include>
										<include>web/html/</include>
										<include>web/scripts/</include>
										<include>web/styles/</include>
									</includes>
								</fileset>
							</filesets>
						</configuration>

					</plugin>

					<plugin>

						<groupId>org.codehaus.mojo</groupId>
						<artifactId>exec-maven-plugin</artifactId>

						<executions>

							<execution>
								<id>grunt-build</id>
								<phase>generate-resources</phase>
								<goals>
									<goal>exec</goal>
								</goals>
								<configuration>

									<executable>${path.to.common.client}/${node.modules.bin}/${grunt.executable}</executable>

									<arguments>
										<argument>--base</argument>
										<argument>${path.to.common.client}</argument>
									</arguments>

									<environmentVariables>
										<PATH>${basedir}/${path.to.node.folder}${path.separator}${env.PATH}</PATH>
									</environmentVariables>

								</configuration>
							</execution>

						</executions>

					</plugin>

				</plugins>

			</build>
		</profile>

	</profiles>

</project>