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

	<!-- Model Version -->
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.mobicents.applications.ussd</groupId>
		<artifactId>ussdgateway</artifactId>
		<version>1.0.0.BETA1</version> 
	</parent>

	<packaging>jar</packaging>


	<artifactId>ussdgateway-rules</artifactId>
	<name>USSD Gateway Rules Service</name>
	<description>USSD Gateway Rules Service</description>

	<dependencies>
		<dependency>
			<groupId>${pom.groupId}</groupId>
			<artifactId>ussdgateway-domain</artifactId>
			<version>${pom.version}</version>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>org.jboss.microcontainer</groupId>
			<artifactId>jboss-dependency</artifactId>
			<version>${version.jboss.microcontainer}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>concurrent</groupId>
			<artifactId>concurrent</artifactId>
			<version>${version.concurrent}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.jboss.microcontainer</groupId>
			<artifactId>jboss-kernel</artifactId>
			<version>${version.jboss.microcontainer}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.jboss.microcontainer</groupId>
			<artifactId>jboss-aop-mc-int</artifactId>
			<version>${version.jboss.microcontainer}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>apache-xerces</groupId>
			<artifactId>xml-apis</artifactId>
			<version>${version.xerces}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.jboss.jbossas</groupId>
			<artifactId>jboss-as-system-jmx</artifactId>
			<scope>provided</scope>
		</dependency>

		<!-- Drools dependencies -->
		<dependency>
			<groupId>org.drools</groupId>
			<artifactId>drools-core</artifactId>
			<version>${drools.version}</version>
		</dependency>
		<dependency>
			<groupId>org.drools</groupId>
			<artifactId>drools-compiler</artifactId>
			<version>${drools.version}</version>
		</dependency>
		<dependency>
			<groupId>org.drools</groupId>
			<artifactId>drools-decisiontables</artifactId>
			<version>${drools.version}</version>
		</dependency>
		<dependency>
			<groupId>org.drools</groupId>
			<artifactId>drools-templates</artifactId>
			<version>${drools.version}</version>
		</dependency>
		<dependency>
			<groupId>org.drools</groupId>
			<artifactId>drools-api</artifactId>
			<version>${drools.version}</version>
		</dependency>
		<dependency>
			<groupId>org.mvel</groupId>
			<artifactId>mvel2</artifactId>
			<version>${mvel.dep.version}</version>
		</dependency>

		<dependency>
			<groupId>org.antlr</groupId>
			<artifactId>antlr-runtime</artifactId>
			<version>3.1.1</version>
		</dependency>

		<!-- External dependencies -->
		<dependency>
			<groupId>foxtrot</groupId>
			<artifactId>foxtrot</artifactId>
			<version>2.0</version>
		</dependency>
		<dependency>
			<groupId>com.jgoodies</groupId>
			<artifactId>forms</artifactId>
			<version>1.2.1</version>
		</dependency>

	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.5</source>
					<target>1.5</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-eclipse-plugin</artifactId>
				<version>2.8</version>
				<configuration>
					<eclipseProjectName>
						ussdgateway-rules
					</eclipseProjectName>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<addMavenDescriptor>false</addMavenDescriptor>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<configuration>
					<descriptors>
						<descriptor>
							src/main/assembly/pojo.xml
						</descriptor>
					</descriptors>
					<finalName>${application.name}</finalName>
				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>directory-inline</goal>
						</goals>
					</execution>
				</executions>
			</plugin>


			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<executions>
					<execution>
						<id>deploy</id>
						<phase>install</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<tasks>
								<echo>
									${jboss.home}server/default/deploy
								</echo>
								<echo>
									${project.build.directory}/${application.name}-gateway
								</echo>
								<copy todir="${jboss.home}/server/${node}/deploy/${application.name}">
									<fileset dir="${project.build.directory}/${application.name}-pojo">

									</fileset>
								</copy>
								
								<unzip src="${project.basedir}/src/main/guvnor/drools-guvnor.war.zip" dest="${jboss.home}/server/${node}/deploy/${application.name}/" />
								
							</tasks>
						</configuration>
					</execution>
					<execution>
						<id>undeploy</id>
						<phase>clean</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<tasks>
								<delete failonerror="false" includeemptydirs="true">
									<fileset dir="${jboss.home}/server/${node}/deploy/${application.name}" />
								</delete>
							</tasks>
						</configuration>
					</execution>
				</executions>
			</plugin>

		</plugins>
	</build>

</project>
