<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>
	<name>Errai::Demos::RestDemo</name>
	<groupId>org.jboss.errai</groupId>
	<artifactId>jaxrs-demo</artifactId>
	<packaging>war</packaging>

	<properties>
		<webXmlPath>src/jetty/web.xml</webXmlPath>
	</properties>

	<!-- Parent -->
	<parent>
		<artifactId>jaxrs-integration-parent</artifactId>
		<groupId>org.jboss.errai</groupId>
		<version>2.0.pre0</version>
		<relativePath>../../pom.xml</relativePath>
	</parent>

	<dependencies>
		<dependency>
			<groupId>org.jboss.errai</groupId>
			<artifactId>errai-bus</artifactId>
		</dependency>
		<dependency>
			<groupId>org.jboss.errai</groupId>
			<artifactId>errai-ioc</artifactId>
		</dependency>
		<dependency>
			<groupId>org.jboss.errai</groupId>
			<artifactId>errai-tools</artifactId>
		</dependency>
		
		<dependency>
			<groupId>org.jboss.errai</groupId>
			<artifactId>errai-jaxrs-client</artifactId>
			<version>${version}</version>
		</dependency>
		
		<dependency>
			<groupId>org.jboss.errai</groupId>
			<artifactId>errai-jaxrs-provider</artifactId>
			<version>${version}</version>
		</dependency>
		
		<dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>1.0-SP4</version>
        </dependency>

		<dependency>
			<groupId>com.google.gwt</groupId>
			<artifactId>gwt-user</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.google.gwt</groupId>
			<artifactId>gwt-dev</artifactId>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.jboss.resteasy</groupId>
			<artifactId>resteasy-jaxrs</artifactId>
			<version>2.2.1.GA</version>
			<scope>provided</scope>
		</dependency>
		
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
		</dependency>

		<dependency>
			<groupId>org.mvel</groupId>
			<artifactId>mvel2</artifactId>
			<version>${mvel.version}</version>
		</dependency>
	</dependencies>

	<build>
		<finalName>${project.artifactId}</finalName>
		<outputDirectory>war/WEB-INF/classes</outputDirectory>
		<plugins>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>gwt-maven-plugin</artifactId>
				<version>${gwt.maven}</version>
				<configuration>
					<inplace>true</inplace>
					<logLevel>INFO</logLevel>
					<runTarget>RestDemo.html</runTarget>
					<warSourceDirectory>war</warSourceDirectory>
					<extraJvmArgs>-Xmx512m</extraJvmArgs>
					<soyc>false</soyc>
					<webXml>${webXmlPath}</webXml>
					<hostedWebapp>war</hostedWebapp>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>compile</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-war-plugin</artifactId>
				<configuration>
					<warSourceDirectory>war</warSourceDirectory>
					<webXml>${webXmlPath}</webXml>
					<packagingExcludes>**/javax/**/*.*,**/client/local/**/*.class</packagingExcludes>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-clean-plugin</artifactId>
				<version>2.2</version>
				<configuration>
					<skip>true</skip>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.2</version>
				<executions>
					<execution>
						<id>clean.war</id>
						<phase>clean</phase>
						<configuration>
							<tasks>
								<!-- The gwt-maven-plugin use the war source folder as it's build 
									directory. We need to cleanup after we'd run the plugin and remove all GWT 
									related artifacts that are required to run the hosted mode. -->
								<delete dir="war/WEB-INF/classes" />
								<delete dir="war/WEB-INF/lib" />
								<delete dir="war/RPCDemo" />
								<delete dir="target" />

							</tasks>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
	<profiles>
		<profile>
			<id>jboss5</id>

			<properties>
				<webXmlPath>src/jboss/web.xml</webXmlPath>
			</properties>

			<dependencies>
				<dependency>
					<groupId>org.jboss.errai</groupId>
					<artifactId>errai-ioc</artifactId>
					<exclusions>
						<exclusion>
							<artifactId>jsr250-api</artifactId>
							<groupId>javax.annotation</groupId>
						</exclusion>
					</exclusions>
					<scope>provided</scope>
					<version>${version}</version>
				</dependency>

				<dependency>
					<groupId>org.slf4j</groupId>
					<artifactId>slf4j-api</artifactId>
					<version>1.5.10</version>
					<scope>provided</scope>
				</dependency>

				<dependency>
					<groupId>org.slf4j</groupId>
					<artifactId>slf4j-log4j12</artifactId>
					<version>1.5.10</version>
					<scope>provided</scope>
				</dependency>

				<dependency>
					<groupId>javassist</groupId>
					<artifactId>javassist</artifactId>
					<version>3.12.1.GA</version>
					<scope>provided</scope>
				</dependency>

				<dependency>
					<groupId>org.jboss.resteasy</groupId>
					<artifactId>resteasy-jaxrs</artifactId>
					<version>2.2.1.GA</version>
					<scope>provided</scope>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>jboss6</id>

			<properties>
				<webXmlPath>src/jboss/web.xml</webXmlPath>
			</properties>

			<dependencies>
				<dependency>
					<groupId>org.jboss.errai</groupId>
					<artifactId>errai-ioc</artifactId>
					<exclusions>
						<exclusion>
							<artifactId>jsr250-api</artifactId>
							<groupId>javax.annotation</groupId>
						</exclusion>
						<exclusion>
							<artifactId>javax.inject</artifactId>
							<groupId>javax.inject</groupId>
						</exclusion>
					</exclusions>
					<scope>provided</scope>
					<version>${version}</version>
				</dependency>

				<dependency>
					<groupId>javax.inject</groupId>
					<artifactId>javax.inject</artifactId>
					<version>1</version>
					<scope>provided</scope>
				</dependency>

				<dependency>
					<groupId>org.slf4j</groupId>
					<artifactId>slf4j-api</artifactId>
					<version>1.5.10</version>
					<scope>provided</scope>
				</dependency>

				<dependency>
					<groupId>org.slf4j</groupId>
					<artifactId>slf4j-log4j12</artifactId>
					<version>1.5.10</version>
					<scope>provided</scope>
				</dependency>

				<dependency>
					<groupId>javassist</groupId>
					<artifactId>javassist</artifactId>
					<version>3.12.1.GA</version>
					<scope>provided</scope>
				</dependency>

				<dependency>
					<groupId>org.jboss.resteasy</groupId>
					<artifactId>resteasy-jaxrs</artifactId>
					<version>2.2.1.GA</version>
					<scope>provided</scope>
				</dependency>
			</dependencies>
		</profile>
		<profile>
			<id>jboss7</id>

			<properties>
				<webXmlPath>src/jboss/web.xml</webXmlPath>
			</properties>
		</profile>
		<profile>
			<id>tomcat</id>

			<properties>
				<webXmlPath>src/tomcat/web.xml</webXmlPath>
			</properties>
		</profile>
	</profiles>
</project>
