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

	<modelVersion>4.0.0</modelVersion>


	<!-- POM Identification -->

	<groupId>test</groupId>
	<artifactId>test</artifactId>
	<packaging>pom</packaging>
	<version>0.1-SNAPSHOT</version>

	<name>Test</name>

	<!-- Parent POM -->

	<parent>
		<groupId>test</groupId>
		<artifactId>parent</artifactId>
		<version>0.1-SNAPSHOT</version>
	</parent>

	<dependencies>
		<dependency>
			<groupId>test</groupId>
			<artifactId>web</artifactId>
			<type>war</type>
			<scope>compile</scope>
			<version>0.1-SNAPSHOT</version>
		</dependency>

		<dependency>
			<groupId>org.mortbay.jetty</groupId>
			<artifactId>jsp-2.1</artifactId>
			<version>6.1.0rc1</version>
			<scope>compile</scope>
		</dependency>

		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>jstl</artifactId>
			<version>1.1.2</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>taglibs</groupId>
			<artifactId>standard</artifactId>
			<version>1.1.2</version>
			<scope>compile</scope>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>3.8.1</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<!-- Reconfigure Test Source Directory from Default Setting -->
		<!--		<testSourceDirectory>src/main/test</testSourceDirectory>-->
		<!--		<testOutputDirectory>target/it-classes</testOutputDirectory>-->

		<plugins>
			<!--
				Since this is a pom packaged module, generating the test resources
				must be configured manually
			-->
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<executions>
					<execution>
						<!--						<phase>pre-integration-test</phase>-->
						<goals>
							<goal>testResources</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!--
				Since this is a pom packaged module, running the tests must be
				configured manually
			-->
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<executions>
					<execution>
						<!--						<phase>pre-integration-test</phase>-->
						<goals>
							<goal>testCompile</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!--
				Since this is a pom packaged module, generating the site must be
				configured manually
			-->
			<plugin>
				<artifactId>maven-surefire-plugin</artifactId>
				<executions>
					<execution>
						<!--						<phase>integration-test</phase>-->
						<goals>
							<goal>test</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- Integration Test Embedded Servlet Container -->
			<plugin>
				<groupId>org.codehaus.cargo</groupId>
				<artifactId>cargo-maven2-plugin</artifactId>
				<configuration>
					<wait>false</wait>
					<container>
						<containerId>jetty6x</containerId>
						<type>embedded</type>
						<log>${project.build.directory}/log</log>
						<output>${project.build.directory}/out</output>
						<dependencies>
							<dependency>
								<groupId>javax.servlet</groupId>
								<artifactId>jstl</artifactId>
							</dependency>
							<dependency>
								<groupId>taglibs</groupId>
								<artifactId>standard</artifactId>
							</dependency>
						</dependencies>
						<systemProperties>
							<DEBUG>true</DEBUG>
						</systemProperties>
					</container>
					<configuration>
						<properties>
							<cargo.servlet.port>8090</cargo.servlet.port>
							<cargo.logging>high</cargo.logging>
						</properties>
						<deployables>
							<deployable>
								<groupId>test</groupId>
								<artifactId>web</artifactId>
								<type>war</type>
								<properties>
									<context>taglibs-test</context>
								</properties>
							</deployable>
						</deployables>
					</configuration>
				</configuration>
				<executions>
					<execution>
						<id>start-container</id>
						<phase>test-compile</phase>
						<!--						<phase>pre-integration-test</phase>-->
						<goals>
							<goal>start</goal>
						</goals>
					</execution>
					<execution>
						<id>stop-container</id>
						<phase>package</phase>
						<!--						<phase>post-integration-test</phase>-->
						<goals>
							<goal>stop</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
