<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>
		<artifactId>seam-rest-parent</artifactId>
		<groupId>org.jboss.seam.rest</groupId>
		<version>3.0.0.Alpha3</version>
		<relativePath>../pom.xml</relativePath>
	</parent>

	<artifactId>seam-rest-impl</artifactId>
	<version>3.0.0.Alpha3</version>

	<packaging>jar</packaging>
	<name>Seam REST Module Implementation</name>

	<dependencies>
		<dependency>
			<artifactId>seam-rest-api</artifactId>
			<groupId>org.jboss.seam.rest</groupId>
		</dependency>

		<dependency>
			<groupId>org.jboss.seam.solder</groupId>
			<artifactId>seam-solder-api</artifactId>
		</dependency>

		<dependency>
			<groupId>org.jboss.seam.solder</groupId>
			<artifactId>seam-solder-impl</artifactId>
		</dependency>

		<dependency>
			<groupId>org.jboss.spec.javax.el</groupId>
			<artifactId>jboss-el-api_2.2_spec</artifactId>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.jboss.logging</groupId>
			<artifactId>jboss-logging</artifactId>
		</dependency>

		<dependency>
			<groupId>org.jboss.seam.servlet</groupId>
			<artifactId>seam-servlet-api</artifactId>
		</dependency>

		<dependency>
			<groupId>org.jboss.seam.servlet</groupId>
			<artifactId>seam-servlet-impl</artifactId>
		</dependency>

		<!-- Optional dependencies -->
		<dependency>
			<groupId>org.jboss.seam.catch</groupId>
			<artifactId>seam-catch-api</artifactId>
			<scope>provided</scope>
		</dependency>
		
		<dependency>
			<groupId>org.freemarker</groupId>
			<artifactId>freemarker</artifactId>
			<scope>provided</scope>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>org.apache.velocity</groupId>
			<artifactId>velocity</artifactId>
			<scope>provided</scope>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>org.apache.velocity</groupId>
			<artifactId>velocity-tools</artifactId>
			<scope>provided</scope>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>org.jboss.resteasy</groupId>
			<artifactId>resteasy-jaxrs</artifactId>
		</dependency>

		<!-- Test dependencies -->
		<dependency>
			<groupId>org.jboss.arquillian</groupId>
			<artifactId>arquillian-junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>commons-httpclient</groupId>
			<artifactId>commons-httpclient</artifactId>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-simple</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.jboss.spec.javax.ejb</groupId>
			<artifactId>jboss-ejb-api_3.1_spec</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.jboss.seam.catch</groupId>
			<artifactId>seam-catch-impl</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-libraries</id>
						<phase>process-resources</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<includeArtifactIds>freemarker,seam-solder-api,seam-solder-impl,jboss-logging,slf4j-simple,slf4j-api,velocity,velocity-tools,commons-lang,seam-servlet-api,seam-servlet-impl,seam-catch-api,seam-catch-impl,commons-collections</includeArtifactIds>
							<outputDirectory>${basedir}/target/lib</outputDirectory>
							<stripVersion>true</stripVersion>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<additionalClasspathElements>
						<additionalClasspathElement>${basedir}/target/lib</additionalClasspathElement>
					</additionalClasspathElements>
					<excludes>
						<exclude>**/CatchExceptionMappingTest.java</exclude> <!-- Disabled for now SEAMREST-12 -->
					</excludes>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>code-coverage</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>emma-maven-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<executions>
							<execution>
								<id>deploy-emma-jar</id>
								<phase>process-test-sources</phase>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<tasks>
										<echo message="Deploying emma jar to server lib directory" />
										<copy file="${emma.jar.file}" todir="${env.JBOSS_HOME}/server/default/lib" overwrite="true" />
									</tasks>
								</configuration>
							</execution>
							<execution>
								<id>retrieve-coverage-file</id>
								<phase>test</phase>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<tasks>
										<move file="${env.JBOSS_HOME}/bin/coverage.ec" todir="${basedir}" failonerror="false" />
										<delete file="${basedir}/transaction.log" failonerror="false" />
									</tasks>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>emma-maven-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.sonatype.maven.plugin</groupId>
						<artifactId>emma4it-maven-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<activation>
				<property>
					<name>managed</name>
				</property>
			</activation>
			<id>jbossas-managed-6</id>
			<properties>
				<bindAddress>localhost</bindAddress>
				<httpPort>8080</httpPort>
			</properties>
			<dependencies>
				<dependency>
					<groupId>org.jboss.jbossas</groupId>
					<artifactId>jboss-as-client</artifactId>
					<type>pom</type>
					<scope>test</scope>
				</dependency>
				<dependency>
					<groupId>org.jboss.arquillian.container</groupId>
					<artifactId>arquillian-jbossas-managed-6</artifactId>
					<scope>test</scope>
				</dependency>
				<dependency>
					<groupId>org.jboss.jbossas</groupId>
					<artifactId>jboss-server-manager</artifactId>
					<scope>test</scope>
				</dependency>
			</dependencies>
		</profile>

		<profile>
			<id>jbossas-remote-6</id>
			<dependencies>
				<dependency>
					<groupId>org.jboss.jbossas</groupId>
					<artifactId>jboss-as-client</artifactId>
					<type>pom</type>
					<scope>test</scope>
				</dependency>
				<dependency>
					<groupId>org.jboss.arquillian.container</groupId>
					<artifactId>arquillian-jbossas-remote-6</artifactId>
					<scope>test</scope>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>glassfish-embedded-3</id>
			<dependencies>
				<dependency>
					<groupId>org.jboss.arquillian.container</groupId>
					<artifactId>arquillian-glassfish-embedded-3</artifactId>
				</dependency>
				<dependency>
					<groupId>org.glassfish.extras</groupId>
					<artifactId>glassfish-embedded-all</artifactId>
				</dependency>
				<dependency>
					<groupId>org.jboss.logging</groupId>
					<artifactId>jboss-logging</artifactId>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>glassfish-remote-3</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<dependencies>
				<dependency>
					<groupId>org.jboss.arquillian.container</groupId>
					<artifactId>arquillian-glassfish-remote-3</artifactId>
					<version>${arquillian.version}</version>
					<scope>test</scope>
				</dependency>
				<dependency>
					<groupId>org.glassfish.deployment</groupId>
					<artifactId>deployment-client</artifactId>
				</dependency>
			</dependencies>
			<!-- Exclude RESTEasy-dependent tests -->
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<excludes>
								<exclude>**/RestClientTest.java</exclude>
							</excludes>
						</configuration>
					</plugin>
				</plugins>
			</build>

		</profile>
	</profiles>
</project>

