<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>
	<packaging>pom</packaging>

	<parent>
		<artifactId>mobicents-jainslee-server</artifactId>
		<groupId>org.mobicents</groupId>
		<version>1.2.3.GA</version>
		<relativePath>../../pom.xml</relativePath>
	</parent>

	<artifactId>sip-services-parent</artifactId>
	<groupId>org.mobicents.examples</groupId>

	<name>Mobicents :: Examples :: ${pom.artifactId}</name>

	<properties>
		<!-- define which location service to use -->
		<!-- location.service.className>org.mobicents.slee.services.sip.location.jpa.JPALocationService</location.service.className-->
		<location.service.className>org.mobicents.slee.services.sip.location.nonha.NonHALocationService</location.service.className>
	</properties>
	
	<modules>
  	    <module>common</module>
		<module>location</module>
		<module>proxy-sbb</module>
		<module>registrar-sbb</module>
		<module>proxy-with-initial-invite-sbbdescriptor</module>
		<module>proxy-without-initial-invite-sbbdescriptor</module>
	</modules>

	<profiles>
		<profile>
    		<id>maven-release</id>
    		<!-- need to include those ones for maven releases -->
    		<modules>
    			<module>balancer</module>
    			<module>proxy-with-initial-invite-services-DU</module>
    			<module>proxy-without-initial-invite-services-DU</module>
    		</modules>
    	</profile>
		<profile>
			<id>release</id>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-antrun-plugin</artifactId>
						<inherited>false</inherited>
						<executions>
							<execution>
								<phase>install</phase>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<tasks>
									  <!-- Build the DUs for the release. -->
                    <condition property="executable" value="mvn.bat">
                      <os family="windows" />
                    </condition>
                    <property name="executable" value="mvn" />
                    <exec executable="${executable}">
                      <arg value="-f" />
                      <arg value="./proxy-with-initial-invite-services-DU/pom.xml" />
                      <arg value="install" />
                    </exec>
                    <exec executable="${executable}">
                      <arg value="-f" />
                      <arg value="./proxy-without-initial-invite-services-DU/pom.xml" />
                      <arg value="install" />
                    </exec>
                    <!-- End of Build the DUs for the release. -->
                    
										<copy overwrite="true" todir="${basedir}/../../release/${release.name}/examples/sip-services">
											<fileset dir="${basedir}/proxy-without-initial-invite-services-DU/target">
												<include name="**.jar" />
												<include name="*.xml" />
												<include name="*.properties" />
											</fileset>
											<fileset dir="${basedir}/proxy-with-initial-invite-services-DU/target">
												<include name="**.jar" />
												<include name="*.xml" />
												<include name="*.properties" />
											</fileset>
										</copy>
										<copy overwrite="true" file="${basedir}/proxy-without-initial-invite-services-DU/target/build.xml" tofile="${basedir}/../../release/${release.name}/examples/sip-services/proxy-without-initial-invite-du-management.xml" />
										<copy overwrite="true" file="${basedir}/proxy-with-initial-invite-services-DU/target/build.xml" tofile="${basedir}/../../release/${release.name}/examples/sip-services/proxy-with-initial-invite-du-management.xml" />
										<copy overwrite="true" file="${basedir}/release/build.xml" todir="${basedir}/../../release/${release.name}/examples/sip-services">
											<filterset>
												<filter token="JBOSS.PATH" value="${jboss.path}" />
                      							<filter token="JBOSS.CONFIG" value="${node}" />
											</filterset>
										</copy>
									</tasks>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>