<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>fr.spi4j</groupId>
		<artifactId>appwhite1</artifactId>
		<version>1.7-SNAPSHOT</version>
	</parent>
	<artifactId>appwhite1-client-gwt</artifactId>
	<packaging>jar</packaging>
	<name>Application blanche - Client RIA GWT</name>
	<licenses>
		<license>
			<name>ASL</name>
			<url>LICENSE</url>
		</license>
	</licenses>

	<dependencies>
		<!-- dépendance vers gwt-servlet amenée transitivement par spi4j-gwt -->
		<!-- <dependency> -->
		<!-- <groupId>com.google.gwt</groupId> -->
		<!-- <artifactId>gwt-servlet</artifactId> -->
		<!-- <version>2.7.0</version> -->
		<!-- </dependency> -->
		<dependency>
			<groupId>com.google.gwt</groupId>
			<artifactId>gwt-user</artifactId>
			<version>2.7.0</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>fr.spi4j</groupId>
			<artifactId>appwhite1-server</artifactId>
			<version>${project.version}</version>
			<!-- Ce client léger n'a pas besoin des web services -->
			<exclusions>
				<exclusion>
					<groupId>org.apache.cxf</groupId>
					<artifactId>cxf-rt-frontend-jaxws</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.apache.cxf</groupId>
					<artifactId>cxf-rt-transports-http</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>fr.spi4j</groupId>
			<artifactId>spi4j-lib-jbehave</artifactId>
			<version>${project.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>fr.spi4j</groupId>
			<artifactId>spi4j-gwt</artifactId>
			<version>${project.version}</version>
		</dependency>
		<!-- dépendance vers spi4j-gwt avec classifier gwt pour avoir les sources -->
		<dependency>
			<groupId>fr.spi4j</groupId>
			<artifactId>spi4j-gwt</artifactId>
			<version>${project.version}</version>
			<classifier>gwt</classifier>
		</dependency>
		<!-- dépendance vers spi4j-lib-security-commons avec classifier gwt pour avoir les sources -->
		<dependency>
			<groupId>fr.spi4j</groupId>
			<artifactId>spi4j-lib-security-commons</artifactId>
			<version>${project.version}</version>
			<classifier>gwt</classifier>
		</dependency>
		<dependency>
			<!-- activation du monitoring -->
			<groupId>net.bull.javamelody</groupId>
			<artifactId>javamelody-core</artifactId>
			<version>1.54.0</version>
		</dependency>
		<!-- Dépendance iText pour exports PDF dans le monitoring -->
		<dependency>
			<groupId>com.lowagie</groupId>
			<artifactId>itext</artifactId>
			<version>2.1.7</version>
			<exclusions>
				<exclusion>
					<artifactId>bcmail-jdk14</artifactId>
					<groupId>bouncycastle</groupId>
				</exclusion>
				<exclusion>
					<artifactId>bcprov-jdk14</artifactId>
					<groupId>bouncycastle</groupId>
				</exclusion>
				<exclusion>
					<artifactId>bctsp-jdk14</artifactId>
					<groupId>bouncycastle</groupId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- Utilisation d'une base h2 pour les tests -->
		<dependency>
			<groupId>com.h2database</groupId>
			<artifactId>h2</artifactId>
			<version>1.3.176</version>
			<scope>test</scope>
		</dependency>

		<!-- Dépendances pour compilation GWT : les sources de l'application sont requises -->
		<dependency>
			<groupId>fr.spi4j</groupId>
			<artifactId>appwhite1-commons</artifactId>
			<version>${project.version}</version>
			<type>java-source</type>
		</dependency>
		<dependency>
			<groupId>fr.spi4j</groupId>
			<artifactId>referentiel-commons</artifactId>
			<version>${project.version}</version>
			<type>java-source</type>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.2</version>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
					<compilerArgument>-Xlint</compilerArgument>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.18</version>
				<configuration>
					<testFailureIgnore>true</testFailureIgnore>
					<!-- -Dfile.encoding=UTF-8 est nécessaire pour que les tests jbehave 
						dans maven sous windows fonctionnent (car JBehave ne sait lire les fichiers 
						story qu'avec le charset par défaut, Cp1252 sous Windows, et n'accepte aucune 
						configuration) -->
					<!-- Utilisation d'une base H2 pour le lancement des tests -->
					<argLine>-Xmx128m -Dfile.encoding=UTF-8 -Dtest.h2=true</argLine>
					<includes>
						<include>**/stories/**/*.java</include>
						<include>**/*_Test.java</include>
						<include>**/Test*.java</include>
					</includes>
				</configuration>
			</plugin>

			<plugin>
				<!-- Note : si utilisation du plugin m2e v1.0 dans Eclipse, il peut y 
					avoir des erreurs sur certains goals voir http://wiki.eclipse.org/M2E_plugin_execution_not_covered 
					et il est possible avec le Quick-Fix d'ajouter une configuration dans le 
					pom pour ignorer ces problèmes -->
				<artifactId>maven-dependency-plugin</artifactId>
				<version>2.5.1</version>
				<executions>
					<!-- Mise en place des fichiers pour le site JBehave -->
					<execution>
						<id>unpack-jbehave-site-resources</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>unpack</goal>
						</goals>
						<configuration>
							<overwriteReleases>false</overwriteReleases>
							<overwriteSnapshots>true</overwriteSnapshots>
							<artifactItems>
								<artifactItem>
									<groupId>org.jbehave.site</groupId>
									<artifactId>jbehave-site-resources</artifactId>
									<version>3.1.1</version>
									<type>zip</type>
									<outputDirectory>
										${project.build.directory}/jbehave/view
									</outputDirectory>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
					<execution>
						<id>unpack-jbehave-reports-resources</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>unpack</goal>
						</goals>
						<configuration>
							<overwriteReleases>false</overwriteReleases>
							<overwriteSnapshots>true</overwriteSnapshots>
							<artifactItems>
								<artifactItem>
									<groupId>org.jbehave</groupId>
									<artifactId>jbehave-core</artifactId>
									<version>3.4.5</version>
									<outputDirectory>
										${project.build.directory}/jbehave/view
									</outputDirectory>
									<includes>
										**\/*.css,**\/*.ftl,**\/*.js
									</includes>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>gwt-maven-plugin</artifactId>
				<version>2.7.0</version>
				<executions>
					<execution>
						<goals>
							<goal>compile</goal>
							<!-- <goal>generateAsync</goal> -->
							<!-- <goal>test</goal> -->
						</goals>
					</execution>
				</executions>
				<!-- <configuration> -->
				<!-- <compileSourcesArtifacts> -->
				<!-- <artifact>fr.spi4j:spi4j_ui</artifact> -->
				<!-- <artifact>fr.spi4j:spi4j</artifact> -->
				<!-- <artifact>fr.appwhite1:Appli1_commons</artifact> -->
				<!-- <artifact>fr.spi4j.ui.gwt:spi4j_gwt</artifact> -->
				<!-- </compileSourcesArtifacts> -->
				<!-- </configuration> -->
			</plugin>
			<plugin>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.5</version>
				<!-- le driver jdbc est une dépendance Maven de ce module (via le module 
					appwhite1-server) pour que l'on puisse facilement lancer la webapp dans Tomcat 
					depuis Eclipse sans configurer de datasource, mais le jar du driver jdbc 
					n'est pas inclus dans le fichier war de cette webapp et c'est le serveur 
					d'application (Tomcat ou GlassFish) qui doit fournir la datasource jdbc à 
					partir du driver jdbc inlus dans le serveur (%TOMCAT_HOME%/lib/postgresql-xxx.jar 
					par exemple) -->
				<!-- On exclut également toutes les dépendances avec classifier gwt car elles font doublons -->
				<configuration>
					<packagingExcludes>WEB-INF/lib/postgresql*.jar,WEB-INF/lib/commons-dbcp*.jar,WEB-INF/lib/commons-pool*.jar,WEB-INF/lib/*-gwt.jar</packagingExcludes>
				</configuration>
				<executions>
					<!-- On ne veut pas mettre le packaging war sur ce pom pour ne pas perturber 
						les configurations eclipse des autres projets, mais par contre on veut fabriquer 
						un war qui contiendra l'application -->
					<execution>
						<id>War</id>
						<phase>package</phase>
						<goals>
							<goal>war</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.7</version>
				<executions>
					<execution>
						<id>WarBuild</id>
						<phase>package</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<target>

								<!-- Pour avoir en plus un nom de fichier war indépendant de la version 
									Maven et qui servira comme nom de webapp dans Tomcat via la configuration 
									de déploiement automatique dans Jenkins -->
								<copy file="target/${project.artifactId}-${project.version}.war" tofile="target/appwhite1-gwt.war" />

							</target>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!-- plugin pour lancer un serveur http jetty, via le goal "jetty:run-exploded -DskipTests"
			(pas "jetty:run" sinon le serveur ne trouve pas /appli1/appli1.nocache.js) -->
			<plugin>
				<groupId>org.mortbay.jetty</groupId>
				<artifactId>maven-jetty-plugin</artifactId>
				<version>6.1.26</version>
				<configuration>
					<scanIntervalSeconds>10</scanIntervalSeconds>
					<!-- <jettyConfig>src/main/config/jetty-jmx.xml</jettyConfig> -->
					<connectors>
						<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
							<port>8080</port>
							<maxIdleTime>60000</maxIdleTime>
						</connector>
					</connectors>
				</configuration>
			</plugin>
		</plugins>

		<testResources>
			<testResource>
				<directory>${project.basedir}/src/test/java</directory>
				<includes>
					<include>**/*.story</include>
				</includes>
			</testResource>
		</testResources>
	</build>
</project>