<?xml version="1.0" encoding="UTF-8"?>
<project>
	<modelVersion>4.0.0</modelVersion>

	<name>Apache James :: Bond</name>
	<groupId>org.apache.james</groupId>
	<artifactId>bond</artifactId>
	<packaging>war</packaging>
	<version>1.0-SNAPSHOT</version>

	<properties>
                <james>3.0-beta4</james>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>1.6</maven.compiler.source>
		<maven.compiler.target>1.6</maven.compiler.target>
		<gQueryVersion>1.3.2</gQueryVersion>
		<gwtversion>2.6.1</gwtversion>
		<gwtmaven>2.6.1</gwtmaven>
                <jetty.version>8.1.6.v20120903</jetty.version>
	</properties>

	<repositories>
		<repository>
			<id>central</id>
			<url>http://repo1.maven.org/maven2</url>
		</repository>
		<repository>
			<id>gwtquery-plugins</id>
			<url>http://gwtquery-plugins.googlecode.com/svn/mavenrepo</url>
		</repository>
		<repository>
			<id>sonatype</id>
			<url>http://oss.sonatype.org/content/repositories/snapshots</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
			<releases>
				<enabled>false</enabled>
			</releases>
		</repository>
	</repositories>

	<scm>
	</scm>

	<issueManagement>
	</issueManagement>

	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.8.1</version>
			<scope>test</scope>
		</dependency>
		<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>runtime</scope>
		</dependency>
		<dependency>
			<groupId>com.google.gwt</groupId>
			<artifactId>gwt-dev</artifactId>
			<version>${gwtversion}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.googlecode.gwtquery</groupId>
			<artifactId>gwtquery</artifactId>
			<version>${gQueryVersion}</version>
			<scope>provided</scope>
		</dependency>
		<!-- GWT 2.3.0 depends on these -->
		<dependency>
			<groupId>javax.validation</groupId>
			<artifactId>validation-api</artifactId>
			<version>1.0.0.GA</version>
		</dependency>
		<dependency>
			<groupId>javax.validation</groupId>
			<artifactId>validation-api</artifactId>
			<version>1.0.0.GA</version>
			<classifier>sources</classifier>
		</dependency>
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-validator</artifactId>
			<version>4.2.0.Final</version>
		</dependency>
		<dependency>
			<groupId>org.json</groupId>
			<artifactId>json</artifactId>
			<version>20090211</version>
		</dependency>

		<!-- JSR 303 -->
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-validator-annotation-processor</artifactId>
			<version>4.2.0.Final</version>
		</dependency>

		<!-- To use james-cli functions for JMX connection -->
		<dependency>
			<groupId>org.apache.james</groupId>
			<artifactId>james-server-cli</artifactId>
			<version>${james}</version>
		</dependency>
		<!-- To have xml templates in our classpath -->
		<dependency>
			<groupId>org.apache.james</groupId>
			<artifactId>apache-james</artifactId>
			<version>${james}</version>
			<exclusions>
				<exclusion>
					<groupId>*</groupId>
					<artifactId>*</artifactId>
				</exclusion>
			</exclusions>
			<scope>provided</scope>
		</dependency>
		<!-- Dependencies to run Bond from command line -->
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-server</artifactId>
			<version>${jetty.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-webapp</artifactId>
			<version>${jetty.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-websocket</artifactId>
			<version>${jetty.version}</version>
			<scope>provided</scope>
		</dependency>

		<!--For Guava cache -->
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>11.0.1</version>
		</dependency>

		<!-- To parse xml -->
		<dependency>
			<groupId>commons-configuration</groupId>
			<artifactId>commons-configuration</artifactId>
			<version>1.7</version>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>2.0.1</version>
		</dependency>
	</dependencies>

	<build>
		<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.1</version>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>com.google.web.bindery</groupId>
						<artifactId>requestfactory-apt</artifactId>
						<version>${gwtversion}</version>
					</dependency>
				</dependencies>
			</plugin>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>gwt-maven-plugin</artifactId>
				<version>${gwtmaven}</version>
				<configuration>
					<logLevel>${gwt.loglevel}</logLevel>
					<style>${gwt.outputstyle}</style>
					<gwtVersion>${gwtversion}</gwtVersion>
					<compileReport>true</compileReport>
					<runTarget>Bond/Bond.html</runTarget>
					<hostedWebApp>${project.build.directory}/${project.build.finalName}</hostedWebApp>
				</configuration>
				<executions>
					<execution>
						<phase>prepare-package</phase>
						<goals>
							<goal>compile</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.8.1</version>
				<configuration>
					<additionalClasspathElements>
						<additionalClasspathElement>\${project.build.sourceDirectory}</additionalClasspathElement>
						<additionalClasspathElement>\${project.build.testSourceDirectory}</additionalClasspathElement>
					</additionalClasspathElements>
					<useManifestOnlyJar>false</useManifestOnlyJar>
					<forkMode>always</forkMode>
					<systemProperties>
						<property>
							<name>gwt.args</name>
							<value>-out target/gwt-tests</value>
						</property>
						<property>
							<name>gwt.persistentunitcache</name>
							<value>false</value>
						</property>
					</systemProperties>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-eclipse-plugin</artifactId>
				<version>2.7</version>
				<configuration>
					<downloadSources>true</downloadSources>
					<downloadJavadocs>false</downloadJavadocs>
					<additionalBuildcommands>
						<buildcommand>com.google.gwt.eclipse.core.gwtProjectValidator</buildcommand>
						<buildcommand>org.eclipse.wst.common.modulecore.ComponentStructuralBuilder</buildcommand>
						<buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
						<buildcommand>org.eclipse.wst.common.modulecore.ComponentStructuralBuilderDependencyResolver</buildcommand>
					</additionalBuildcommands>
					<additionalProjectnatures>
						<projectnature>com.google.gwt.eclipse.core.gwtNature</projectnature>
						<projectnature>org.eclipse.jdt.core.javanature</projectnature>
						<projectnature>org.eclipse.wst.common.modulecore.ModuleCoreNature</projectnature>
					</additionalProjectnatures>
					<classpathContainers>
						<classpathContainer>com.google.gwt.eclipse.core.GWT_CONTAINER</classpathContainer>
						<classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
						<classpathContainer>org.eclipse.jdt.junit.JUNIT_CONTAINER/3</classpathContainer>
					</classpathContainers>
				</configuration>
			</plugin>

			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<version>2.5</version>
				<executions>
					<execution>
						<!-- GWT plugin does not copy the webapp folder in hosted mode -->
						<id>copy-resources</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
							<resources>
								<resource>
									<directory>src/main/webapp</directory>
									<filtering>true</filtering>
								</resource>
							</resources>
						</configuration>
					</execution>
					<execution>
						<!-- Copy the Jetty Launcher -->
						<id>copy-launcher</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
							<resources>
								<resource>
									<directory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</directory>
									<include>org/apache/james/bond/Launcher.class</include>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<configuration>
					<webXml>src/main/webapp/WEB-INF/web.xml</webXml>
					<archive>
						<manifest>
							<mainClass>org.apache.james.bond.Launcher</mainClass>
						</manifest>
					</archive>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>jetty-classpath</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>unpack-dependencies</goal>
						</goals>
						<configuration>
							<includeGroupIds>org.eclipse.jetty,javax.servlet</includeGroupIds>
							<excludeArtifactIds>jsp-api,jstl</excludeArtifactIds>
							<outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}</outputDirectory>
							<excludes>**\/*.SF,**\/*.DSA,**\/*.RSA</excludes>
						</configuration>
					</execution>
					<execution>
						<id>james-templates</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>unpack-dependencies</goal>
						</goals>
						<configuration>
							<includeGroupIds>org.apache.james</includeGroupIds>
							<includeArtifactIds>apache-james</includeArtifactIds>
							<outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}</outputDirectory>
							<includes>**\/conf\/*.conf</includes>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<!-- Process RequestFactory validations -->
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.5.1</version>
				<dependencies>
					<dependency>
						<groupId>com.google.web.bindery</groupId>
						<artifactId>requestfactory-apt</artifactId>
						<version>${gwtversion}</version>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
	</build>
</project>
