<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>
		<groupId>org.mobicents.servers.media</groupId>
		<artifactId>mms-core</artifactId>
		<version>2.0.0.BETA2</version>
	</parent>

	<artifactId>mms-sar</artifactId>

	<name>Mobicents Media Server[JBoss Service]</name>


	<dependencies>
		<dependency>
			<artifactId>mms-impl</artifactId>
			<groupId>${pom.groupId}</groupId>
			<version>${pom.version}</version>
		</dependency>
		<dependency>
			<groupId>org.mobicents.external.jspeex</groupId>
			<artifactId>jspeex</artifactId>
			<version>0.9.7</version>
		</dependency>

		<dependency>
			<groupId>net.java.stun4j</groupId>
			<artifactId>stun4j</artifactId>
			<version>1.0.MOBICENTS</version>
		</dependency>
		<dependency>
			<groupId>org.mobicents.external.tritonus</groupId>
			<artifactId>tritonus_share</artifactId>
			<version>0.3.6</version>
		</dependency>
		<dependency>
			<groupId>org.mobicents.external.tritonus</groupId>
			<artifactId>tritonus_gsm</artifactId>
			<version>0.3.6</version>
		</dependency>
	</dependencies>

	<build>
		<finalName>mobicents-media-server.sar</finalName>
		<plugins>

			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<configuration>
					<descriptors>
						<descriptor>
							src/main/assemble/descriptor.xml
						</descriptor>
					</descriptors>
					<appendAssemblyId>false</appendAssemblyId>
				</configuration>
				<executions>
					<execution>
						<id>make-assembly</id><!-- this is used for inheritance merges -->
						<phase>package</phase><!-- append to the packaging phase. -->
						<goals>
							<goal>directory-inline</goal><!-- goals == mojos -->
						</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>
								<condition property="jboss.dir" value="${jboss.home}" else="${env.JBOSS_HOME}">
									<isset property="jboss.home" />
								</condition>
								<copy todir="${jboss.home}/server/${node}/deploy/mobicents-media-server">
									<fileset dir="target/${build.finalName}.dir">
										<include name="${build.finalName}/**" />
									</fileset>
								</copy>
								<copy todir="${jboss.home}/server/${node}/deploy/mobicents-media-server">
									<fileset dir="src/main/config">
									</fileset>
								</copy>
								<copy todir="${jboss.home}/server/${node}/deploy/mobicents-media-server/mgcp-controller-service.sar">
									<fileset dir="../controllers/mgcp/target/mgcp-controller-service.dir/mgcp-controller-service">
									</fileset>
								</copy>
							</tasks>
						</configuration>
					</execution>
					<execution>
						<id>undeploy</id>
						<phase>clean</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<tasks>
								<delete dir="${env.JBOSS_HOME}/server/${node}/deploy/mobicents-media-server" />
							</tasks>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

</project>