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

	<parent>
		<groupId>org.mobicents.servlet.sip</groupId>
		<artifactId>sip-servlets-bootstrap</artifactId>
		<version>1.3.1</version>
		<relativePath>../pom.xml</relativePath>
	</parent>
	
	<modelVersion>4.0.0</modelVersion>
	<groupId>org.mobicents.servlet.sip.management</groupId>
	<artifactId>sip-servlets-management</artifactId>
	<packaging>war</packaging>
	<version>1.3.1</version>
	<name>sip-servlets-management</name>

	<!--  include pluginRepository and repository for GWT-Maven -->
	<pluginRepositories>
		<pluginRepository>
			<id>gwt-maven-plugins</id>
			<url>
                http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/
            </url>
		</pluginRepository>
	</pluginRepositories>
	<repositories>
		<repository>
			<id>gwt-maven</id>
			<url>
                http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/
            </url>
		</repository>
		<repository>
			<id>gwt-ext</id>
			<url>
                http://www.gwt-ext.com/maven2/
            </url>
		</repository>
		<repository>
			<id>maven2-repository.dev.java.net</id>
			<name>Java.net Repository for Maven</name>
			<url>http://download.java.net/maven/2/</url>
			<layout>default</layout>
		</repository>
		<repository>			
			<id>JbossRepository</id>
			<name>Jboss Repository</name>
			<url>http://repository.jboss.org/maven2</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
			<releases>
				<enabled>true</enabled>
			</releases>
		</repository>
		<repository>
			<id>jboss-snapshots</id>
			<name>JBoss Snapshot Repository</name>
			<url>http://snapshots.jboss.org/maven2</url>
			<releases>
				<enabled>false</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
	</repositories>

	<!--  convenience to define GWT version in one place -->
	<properties>
		<gwtVersion>1.5.3</gwtVersion>
	</properties>

	<dependencies>
		<!--  GWT deps (from central repo) -->
		<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-user</artifactId>
			<version>${gwtVersion}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.google.gwt</groupId>
			<artifactId>gwt-dev</artifactId>
			<version>${gwtVersion}</version>
			<classifier>${platform}-libs</classifier>
			<type>zip</type>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.google.gwt</groupId>
			<artifactId>gwt-dev</artifactId>
			<version>${gwtVersion}</version>
			<classifier>${platform}</classifier>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.gwtext</groupId>
			<artifactId>gwtext</artifactId>
			<version>2.0.5</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>commons-logging</groupId>
			<artifactId>commons-logging-api</artifactId>
			<version>1.0.4</version>
			<scope>provided</scope>
		</dependency>
				<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.5</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.mobicents.servlet.sip</groupId>
			<artifactId>sip-servlets-spec</artifactId>
			<version>1.1.13.1</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.mobicents.servlet.sip</groupId>
			<artifactId>sip-servlets-annotations</artifactId>
			<version>1.3.1</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.mobicents.servlet.sip</groupId>
			<artifactId>sip-servlets-impl</artifactId>
			<version>1.3.1</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.mobicents.servlet.sip</groupId>
			<artifactId>sip-servlets-application-router</artifactId>
			<version>1.3.1</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>gwt-dnd</groupId>
			<artifactId>gwt-dnd</artifactId>
			<version>2.0.7</version>
			<scope>provided</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
		<plugin>
				<artifactId>maven-install-plugin</artifactId>
				<groupId>org.apache.maven.plugins</groupId>
				<inherited>false</inherited>
				<executions>
					<execution>
						<id>install-gwt-dnd</id>
						<phase>validate</phase>
						<goals><goal>install-file</goal></goals>
						<configuration>
							<file>${basedir}/src/main/java/org/mobicents/servlet/management/public/lib/gwt-dnd-2.0.7.jar</file>
							<groupId>gwt-dnd</groupId>
							<artifactId>gwt-dnd</artifactId>
							<version>2.0.7</version>
							<packaging>jar</packaging>
							<generatePom>true</generatePom>
							<createChecksum>true</createChecksum>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<!--  configure the GWT-Maven plugin -->
			<plugin>
				<groupId>com.totsp.gwt</groupId>
				<artifactId>maven-googlewebtoolkit2-plugin</artifactId>
				<version>2.0-beta24</version>
				<configuration>
					<logLevel>INFO</logLevel>
					<compileTargets>
						<value>org.mobicents.servlet.management.SipServletsManagement</value>
					</compileTargets>
					<runTarget>org.mobicents.servlet.management.SipServletsManagement/SipServletsManagement.html</runTarget>
					<style>DETAILED</style>
					<noServer>false</noServer>
					<extraJvmArgs>-Xmx1012m</extraJvmArgs>
					<!--
						this parameter is VERY important with automatic mode - has to
						match the version in your declared deps
					-->
					<!--
						if this is set incorrect, or left out and default does not match
						(default is 1.5.2 for 2.0-beta23) you will have mysterious errors
					-->
					<gwtVersion>${gwtVersion}</gwtVersion>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>mergewebxml</goal>
							<goal>gwt</goal>
							<goal>compile</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<!--  Use the dependency plugin to unpack gwt-dev-PLATFORM-libs.zip -->
			<!--
				(this is a replacement for the old "automatic" mode - useful if you
				don't have GWT installed already, or you just want a maven way to
				handle gwt deps)
			-->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>unpack</id>
						<phase>compile</phase>
						<goals>
							<goal>unpack</goal>
						</goals>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>com.google.gwt</groupId>
									<artifactId>gwt-dev</artifactId>
									<version>${gwtVersion}</version>
									<classifier>${platform}-libs</classifier>
									<type>zip</type>
									<overWrite>false</overWrite>
									<outputDirectory>${settings.localRepository}/com/google/gwt/gwt-dev/${gwtVersion}</outputDirectory>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<!--
				If you want to use the target/web.xml file mergewebxml produces,
				tell the war plugin to use it. 
				Also, exclude what you want from the final artifact here. 
			-->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<configuration>
					<webXml>target/web.xml</webXml>
                    <warSourceExcludes>.gwt-tmp/**</warSourceExcludes>					
				</configuration>				
			</plugin>
			<!--  tell the compiler we can use 1.5 -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.5</source>
					<target>1.5</target>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<!--  profiles (with activation per platform) -->
	<profiles>
			<profile>			
			<id>deploy</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>			
			<build>			
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<version>1.1</version>
						<executions>
							<execution>
								<phase>package</phase>
								<configuration>
									<tasks>
										<copy verbose="true" file="${project.build.directory}/${project.build.finalName}.${project.packaging}" tofile="${JBOSS_HOME}/server/default/deploy/sip-servlets-management.war" />
									</tasks>
								</configuration>
								<goals>
									<goal>run</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					</plugins>
			</build>
		</profile>
		<profile>
			<id>gwt-dev-windows</id>
			<properties>
				<platform>windows</platform>
			</properties>
			<activation>
				<activeByDefault>true</activeByDefault>
				<os>
					<family>windows</family>
				</os>
			</activation>
		</profile>
		<profile>
			<id>gwt-dev-mac</id>
			<properties>
				<platform>mac</platform>
			</properties>
			<activation>
				<activeByDefault>false</activeByDefault>
				<os>
					<family>mac</family>
				</os>
			</activation>
		</profile>
		<profile>
			<id>gwt-dev-linux</id>
			<properties>
				<platform>linux</platform>
			</properties>
			<activation>
				<activeByDefault>false</activeByDefault>
				<os>
					<name>linux</name>
				</os>
			</activation>
		</profile>
	</profiles>
</project>
