<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ This is part of Geomajas, a GIS framework, http://www.geomajas.org/.
  ~
  ~ Copyright 2008-2013 Geosparc nv, http://www.geosparc.com/, Belgium.
  ~
  ~ The program is available in open source according to the GNU Affero
  ~ General Public License. All contributions in this program are covered
  ~ by the Geomajas Contributors License Agreement. For full licensing
  ~ details, see LICENSE.txt in the project root.
  -->

<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>org.geomajas</groupId>
		<artifactId>geomajas-face-puregwt</artifactId>
		<version>1.0.0-M6</version>
	</parent>

	<artifactId>geomajas-puregwt-example</artifactId>
	<packaging>war</packaging>

	<name>Geomajas PureGWT face: Example showcase</name>
	<description>Geomajas PureGWT face: Example showcase</description>
	<url>http://www.geomajas.org/</url>

	<dependencies>
		
		<!-- Geomajas dependencies -->
		<dependency>
			<groupId>org.geomajas</groupId>
			<artifactId>geomajas-puregwt-example-jar</artifactId>
		</dependency>
		<dependency>
			<groupId>org.geomajas</groupId>
			<artifactId>geomajas-puregwt-example-jar</artifactId>
			<classifier>sources</classifier>
		</dependency>
		<dependency>
			<groupId>org.geomajas.plugin</groupId>
			<artifactId>geomajas-plugin-rasterizing</artifactId>
		</dependency>
		<dependency>
			<groupId>org.geomajas</groupId>
			<artifactId>geomajas-puregwt-client-impl</artifactId>
		</dependency>
		<dependency>
			<groupId>org.geomajas</groupId>
			<artifactId>geomajas-testdata</artifactId>
		</dependency>

		<!-- Google dependencies -->
		<dependency>
			<groupId>com.google.gwt</groupId>
			<artifactId>gwt-user</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.google.gwt</groupId>
			<artifactId>gwt-servlet</artifactId>
			<scope>runtime</scope>
		</dependency>

		<!-- logging dependencies, delegate all to slf4j and use logback -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>jcl-over-slf4j</artifactId>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>log4j-over-slf4j</artifactId>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
		</dependency>

	</dependencies>

	<build>
		<plugins>

			<!-- Run the application using "mvn jetty:run" -->
			<plugin>
				<groupId>org.mortbay.jetty</groupId>
				<artifactId>maven-jetty-plugin</artifactId>
				<version>6.1.20</version>
				<configuration>
					<webAppConfig>
						<contextPath>/</contextPath>
						<baseResource implementation="org.mortbay.resource.ResourceCollection">
							<!-- need both the webapp dir and location where GWT puts stuff -->
							<resourcesAsCSV>${basedir}/src/main/webapp,${project.build.directory}/${project.build.finalName}</resourcesAsCSV>
						</baseResource>
					</webAppConfig>
					<reload>manual</reload>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>gwt-maven-plugin</artifactId>
				<version>2.5.0</version>
				<dependencies>
					<dependency>
						<groupId>com.google.gwt</groupId>
						<artifactId>gwt-user</artifactId>
						<version>${gwt-version}</version>
					</dependency>
					<dependency>
						<groupId>com.google.gwt</groupId>
						<artifactId>gwt-dev</artifactId>
						<version>${gwt-version}</version>
					</dependency>
				</dependencies>
				<configuration>
					<module>org.geomajas.puregwt.example.Example</module>
					<runTarget>index.html</runTarget>
					<disableCastChecking>true</disableCastChecking>
					<disableClassMetadata>true</disableClassMetadata>
					<extraJvmArgs>-Xmx1024M -Xss1024k</extraJvmArgs>
					<hostedWebapp>${project.build.directory}/${project.build.finalName}</hostedWebapp>
					<copyWebapp>true</copyWebapp>
				</configuration>
				<executions>
					<execution>
						<id>compile</id>
						<phase>test-compile</phase>
						<goals>
							<goal>compile</goal>
						</goals>
					</execution>
					<execution>
						<id>clean</id>
						<phase>clean</phase>
						<goals>
							<goal>clean</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

		</plugins>
	</build>

	<profiles>
		<!-- m2eclipse with embedded jetty -->
		<profile>
			<id>m2e</id>
			<activation>
				<property>
					<name>m2e.version</name>
				</property>
			</activation>
			<dependencies>
				<dependency>
					<groupId>org.geomajas</groupId>
					<artifactId>geomajas-jetty-runner</artifactId>
					<version>1.0.0</version>
				</dependency>
				<dependency>
					<groupId>com.google.gwt</groupId>
					<artifactId>gwt-dev</artifactId>
					<version>${gwt-version}</version>
					<scope>provided</scope>
				</dependency>
			</dependencies>
			<properties>
				<gwt.compiler.skip>true</gwt.compiler.skip>
			</properties>
		</profile>
		<profile>
			<id>skipGwt</id>
			<activation>
				<property>
					<name>skipGwt</name>
				</property>
			</activation>
			<properties>
				<gwt.compiler.skip>true</gwt.compiler.skip>
			</properties>
		</profile>

		<profile>
			<id>selenium-tests</id>
			<activation>
				<property>
					<name>!skipSelenium</name>
				</property>
			</activation>
			<build>
				<plugins>
					<!-- Run the application using "mvn jetty:run" -->
					<plugin>
						<groupId>org.mortbay.jetty</groupId>
						<artifactId>maven-jetty-plugin</artifactId>
						<configuration>
							<webAppConfig>
								<contextPath>/</contextPath>
							</webAppConfig>
							<reload>manual</reload>
							<stopPort>9966</stopPort>
							<stopKey>stop-jetty</stopKey>
						</configuration>
						<executions>
							<execution>
								<id>start-jetty</id>
								<phase>pre-integration-test</phase>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<daemon>true</daemon>
									<scanIntervalSeconds>5</scanIntervalSeconds>
									<connectors>
										<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
											<port>9080</port>
											<maxIdleTime>60000</maxIdleTime>
										</connector>
									</connectors>
								</configuration>
							</execution>
							<execution>
								<id>stop-jetty</id>
								<phase>post-integration-test</phase>
								<goals>
									<goal>stop</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<executions>
							<execution>
								<phase>integration-test</phase>
								<goals>
									<goal>test</goal>
								</goals>
								<configuration>
									<includes>
										<include>**/*TestInt.java</include>
										<include>**/IntTest*.java</include>
									</includes>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<properties>
		<gwt-version>2.5.0</gwt-version>
		<gwt.compiler.skip>false</gwt.compiler.skip>
	</properties>

</project>
