<?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">

	<parent>
		<artifactId>maven-parent</artifactId>
		<groupId>org.gcube.tools</groupId>
		<version>1.0.0</version>
		<relativePath />
	</parent>

	<!-- POM file generated with GWT webAppCreator -->
	<modelVersion>4.0.0</modelVersion>
	<groupId>org.gcube.portlets.user</groupId>
	<artifactId>gis-viewer-app</artifactId>
	<packaging>war</packaging>
	<version>1.4.0-4.4.0-131878</version>
	<name>Gis Viewer App</name>
	<description>
		The Gis Viewer App
	</description>

	<scm>
		<connection>scm:svn:http://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/${project.artifactId}</connection>
		<developerConnection>scm:https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/${project.artifactId}</developerConnection>
		<url>http://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/${project.artifactId}</url>
	</scm>
	<properties>
		<!-- Convenience property to set the GWT version -->
		<gwtVersion>2.7.0</gwtVersion>
		<distroDirectory>distro</distroDirectory>
		<!-- GWT needs at least java 1.6 -->
		<maven.compiler.source>1.7</maven.compiler.source>
		<maven.compiler.target>1.7</maven.compiler.target>
		<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>

		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
	</properties>

	<dependencies>

		<!-- GWT -->
		<dependency>
			<groupId>com.google.gwt</groupId>
			<artifactId>gwt-user</artifactId>
			<version>${gwtVersion}</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>com.google.gwt</groupId>
			<artifactId>gwt-servlet</artifactId>
			<version>${gwtVersion}</version>
			<scope>compile</scope>
		</dependency>

		<!-- GXT -->
		<dependency>
			<groupId>com.sencha.gxt</groupId>
			<artifactId>gxt2.2.5-gwt2.X</artifactId>
			<version>${gwtVersion}</version>
			<scope>compile</scope>
		</dependency>

		<dependency>
			<groupId>com.github.gwtbootstrap</groupId>
			<artifactId>gwt-bootstrap</artifactId>
			<version>2.3.2.0</version>
			<scope>compile</scope>
		</dependency>

		<dependency>
			<groupId>org.gcube.spatial.data</groupId>
			<artifactId>geo-utility</artifactId>
			<version>1.1.1-4.4.0-128378</version>
		</dependency>

		<dependency>
			<groupId>org.gcube.core</groupId>
			<artifactId>common-encryption</artifactId>
			<version>1.0.3-4.4.0-142751</version>
			<scope>compile</scope>
		</dependency>

		<!-- GIS VIEWER -->
		<dependency>
			<groupId>org.gcube.portlets.user</groupId>
			<artifactId>gis-viewer</artifactId>
			<version>4.0.0-4.4.0-131946</version>
			<scope>compile</scope>
			<exclusions>
				<exclusion>
					<artifactId>xalan</artifactId>
					<groupId>xalan</groupId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>1.2.16</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
			<version>1.6.4</version>
			<scope>compile</scope>
		</dependency>

	</dependencies>

	<build>

		<!-- <resources> -->
		<!-- <resource> -->
		<!-- <directory>lib</directory> -->
		<!-- <includes> -->
		<!-- <include>*.jar</include> -->
		<!-- </includes> -->
		<!-- <targetPath>${webappDirectory}/WEB-INF/lib</targetPath> -->
		<!-- </resource> -->
		<!-- </resources> -->

		<!-- Generate compiled stuff in the folder used for developing mode -->
		<outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>
		<!-- <finalName>${artifactId}</finalName> -->

		<plugins>
			<!-- GWT Maven Plugin -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>gwt-maven-plugin</artifactId>
				<version>${gwtVersion}</version>
				<executions>
					<execution>
						<goals>
							<goal>compile</goal>
							<!-- <goal>test</goal> -->
						</goals>
					</execution>
				</executions>
				<!-- Plugin configuration. There are many available options, see gwt-maven-plugin 
					documentation at codehaus.org -->
				<configuration>
					<runTarget>GisViewerApp.html</runTarget>
					<hostedWebapp>${webappDirectory}</hostedWebapp>
					<!-- Remove PRETTY to deploy in production -->
					<!-- <style>PRETTY</style> -->
				</configuration>
			</plugin>

			<!-- Copy static web files before executing gwt:run -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.1.1</version>
				<executions>
					<execution>
						<phase>compile</phase>
						<goals>
							<goal>exploded</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<webappDirectory>${webappDirectory}</webappDirectory>

					<!-- COPY GWT-GXT FIX -->
					<webResources>
						<resource>
							<directory>lib</directory>
							<includes>
								<include>*.jar</include>
							</includes>
							<targetPath>/WEB-INF/lib</targetPath>
						</resource>
					</webResources>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.3.2</version>
				<configuration>
					<source>${maven.compiler.source}</source>
					<target>${maven.compiler.target}</target>
				</configuration>
			</plugin>
			<!-- SA Plugin -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.2</version>
				<configuration>
					<descriptors>
						<descriptor>${distroDirectory}/descriptor.xml</descriptor>
					</descriptors>
				</configuration>
				<executions>
					<execution>
						<id>servicearchive</id>
						<phase>install</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<version>2.5</version>
				<executions>
					<execution>
						<id>copy-profile</id>
						<phase>install</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>target</outputDirectory>
							<resources>
								<resource>
									<directory>${distroDirectory}</directory>
									<filtering>true</filtering>
									<includes>
										<include>profile.xml</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>
					<!-- COPY FOLDER LIB CONTENT IN WEB-INF/LIB -->
					<!-- <execution> -->
					<!-- <id>copy-distro-resources</id> -->
					<!-- <phase>process-resources</phase> -->
					<!-- <goals> -->
					<!-- <goal>copy-resources</goal> -->
					<!-- </goals> -->
					<!-- <configuration> -->
					<!-- <outputDirectory>${webappDirectory}/WEB-INF/lib</outputDirectory> -->
					<!-- <resources> -->
					<!-- <resource> -->
					<!-- <directory>lib</directory> -->
					<!-- <filtering>true</filtering> -->
					<!-- <includes> -->
					<!-- <include>*.jar</include> -->
					<!-- </includes> -->
					<!-- </resource> -->
					<!-- </resources> -->
					<!-- </configuration> -->
					<!-- </execution> -->
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
