<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>mobicents-media-server-core</artifactId>
		<version>1.0.0.CR6</version>
	</parent>

	<artifactId>mobicents-media-server-sar</artifactId>

	<name>Mobicents Media Server :: ${pom.artifactId}</name>
	<packaging>jboss-sar</packaging>

	<dependencies>
		<dependency>
			<artifactId>mobicents-media-server-impl</artifactId>
			<groupId>${pom.groupId}</groupId>
			<version>${pom.version}</version>
			<exclusions>
				<exclusion>
					<artifactId>ant</artifactId>
					<groupId>ant-optional</groupId>
				</exclusion>
				<exclusion>
					<artifactId>cactus</artifactId>
					<groupId>cactus</groupId>
				</exclusion>
				<!-- This is sneakly passed, we cant to that with UCL, as instanceof wont return true for the same classes - it check Class objects, whihc for two CLs will differ -->
				<exclusion>
					<artifactId>mobicents-media-server-spi</artifactId>
					<groupId>${pom.groupId}</groupId>
				</exclusion>
				<exclusion>
					<artifactId>mobicents-media-server-constants</artifactId>
					<groupId>${pom.groupId}</groupId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>javax.sip</groupId>
			<artifactId>jain-sip-ri</artifactId>
			<version>${jain-sip-ri.version}</version>			
        	</dependency>
	</dependencies>

	<build>
		<finalName>mobicents-media-server-${pom.version}</finalName>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>jboss-packaging-maven-plugin</artifactId>
				<version>2.0-beta-1</version>
				<extensions>true</extensions>
				<configuration>
					<!--<deploymentDescriptorFile>
						xml/META-INF/jboss-service.xml
						</deploymentDescriptorFile>
					-->
					<excludes>
						<exclude>concurrent:concurrent</exclude>

						<exclude>commons-collections:commons-collections</exclude>
						<exclude>commons-logging:commons-logging</exclude>

						<exclude>ant:ant-optional</exclude>

						<exclude>jboss:jboss</exclude>
						<exclude>jboss:jboss-jmx</exclude>
						<exclude>jboss:jboss-common</exclude>
						<exclude>jboss:jboss-j2se</exclude>
						<exclude>jboss:jboss-minimal</exclude>
						<exclude>jboss:jboss-system</exclude>
						<exclude>jboss:jbossall-client</exclude>
						<exclude>jboss:jbossall</exclude>
						<exclude>jboss:jbossha</exclude>
						<exclude>jboss:jmx-adaptor-plugin</exclude>
						<exclude>javax.transaction:jta</exclude>
						<exclude>junit:junit</exclude>
						<exclude>log4j:log4j</exclude>
						<exclude>javax.servlet:servlet-api</exclude>
						<exclude>jdom:jdom</exclude>
						<exclude>jgroups:jgroups-all</exclude>
						<exclude>xerces:xerces</exclude>
						<exclude>xerces:xercesImpl</exclude>
						<exclude>xml-apis:xml-apis</exclude>
						<exclude>slide:webdavlib</exclude>
					</excludes>

				</configuration>
			</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.dir}/server/${node}/deploy/${project.build.finalName}.sar">
									<fileset dir="target/${project.build.finalName}">
										<include name="**" />
									</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/${project.build.finalName}.sar" />
							</tasks>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

</project>