<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.cluster</groupId>
		<artifactId>example-parent</artifactId>
		<version>1.12</version>
	</parent>
	
	<artifactId>example-beans</artifactId>
		
	<properties>
		<node>all</node>
	</properties>
	
	<dependencies>	
		<dependency>
			<groupId>${pom.groupId}</groupId>
			<artifactId>cache</artifactId>
			<version>${pom.version}</version>
		</dependency>
		<dependency>
			<groupId>${pom.groupId}</groupId>
			<artifactId>timers</artifactId>
			<version>${pom.version}</version>
		</dependency>
		<dependency>
			<groupId>${pom.groupId}</groupId>
			<artifactId>core</artifactId>
			<version>${pom.version}</version>
		</dependency>
		<dependency>
			<groupId>${pom.groupId}</groupId>
           		<artifactId>example-jar</artifactId>
           	<version>${pom.version}</version>           	
		</dependency>
	</dependencies>

	<build>
		<finalName>mobicents-cluster-example</finalName>
		<plugins>
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>		
				<configuration>
					<descriptors>
						<descriptor>
							src/main/assemble/descriptor.xml
						</descriptor>
					</descriptors>
				</configuration>
				<executions>
					<execution>
						<id>make-dir-assembly</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
							<goal>directory-single</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>
								<copy todir="${jboss.home}/server/${node}/deploy">
									<fileset dir="${project.build.directory}/${build.finalName}-beans">
										<include name="${build.finalName}/**" />
									</fileset>
								</copy>
							</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/${build.finalName}" />
								</delete>
							</tasks>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
