<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">
	<parent>
		<groupId>org.mobicents.tools</groupId>
		<artifactId>mobicents-tools-mmc</artifactId>
		<version>1.2.2.GA</version>
	</parent>

	<modelVersion>4.0.0</modelVersion>

	<artifactId>gwt-management-console-war-setup</artifactId>

	<packaging>pom</packaging>

	<profiles>
		<profile>
			<id>maven-release</id>
			<!-- do nothing, this is to avoid the copy of a dependency that doesn't exist yet -->
		</profile>	
		<profile>
			<id>not-maven-release</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-dependency-plugin</artifactId>
						<executions>
							<execution>
								<id>copy-war</id>
								<phase>package</phase>
								<goals>
									<goal>copy</goal>
								</goals>
								<configuration>
									<artifactItems>
										<artifactItem>
											<groupId>
												${pom.groupId}
											</groupId>
											<artifactId>
												gwt-management-console-war
											</artifactId>
											<version>
												${pom.version}
											</version>
											<type>war</type>
											<overWrite>false</overWrite>
											<outputDirectory>
												${project.build.directory}
											</outputDirectory>
											<destFileName>
												management-console.war
											</destFileName>
										</artifactItem>
									</artifactItems>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-antrun-plugin</artifactId>
						<executions>
							<execution>
								<id>deploy-DU</id>
								<phase>install</phase>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<tasks>
										<copy overwrite="true" file="target/management-console.war" todir="${jboss.home}/server/${node}/deploy" />
									</tasks>
								</configuration>
							</execution>
							<execution>
								<id>undeploy-DU</id>
								<phase>clean</phase>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<tasks>
										<delete file="${jboss.home}/server/${node}/deploy/management-console.war" />
									</tasks>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>