<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>

	<!--
		NOTE :
			Refer to sudoor-design/System Management Sketch for detailed Info.
			
			Parent POM ONLY maintain web project:
				Project Info

				Tool:
					wildfly-maven-plugin
						appsvr runtime
					
				SDLC Config:
					test.performance
					test.integration
						websvr runtime
						appsvr runtime
						selenium
						
					openshift

	-->

	<!-- The Basics -->
	<parent>
		<groupId>net.gplatform</groupId>
		<artifactId>gplatform-parent</artifactId>
		<version>1.0.12</version>
		<relativePath />
	</parent>

	<artifactId>sudoor-server-parent</artifactId>
	<version>1.0.17</version>
	<packaging>pom</packaging>

	<properties>
		<org.wildfly.version>8.2.0.Final</org.wildfly.version>
		<org.seleniumhq.selenium.version>2.45.0</org.seleniumhq.selenium.version>
		<webdriver.chrome.driver>/usr/webdriver/chromedriver</webdriver.chrome.driver>

		<runtime.appsvr.container.home>/usr/wildfly-${org.wildfly.version}</runtime.appsvr.container.home>
		<runtime.appsvr.configuration.management.hostname>localhost</runtime.appsvr.configuration.management.hostname>
		<runtime.appsvr.configuration.management.port>9990</runtime.appsvr.configuration.management.port>
		<runtime.appsvr.configuration.management.username>username</runtime.appsvr.configuration.management.username>
		<runtime.appsvr.configuration.management.password>password</runtime.appsvr.configuration.management.password>
		<runtime.appsvr.configuration.domain.server-group>main-server-group</runtime.appsvr.configuration.domain.server-group>

		<runtime.websvr.hostname>localhost</runtime.websvr.hostname>
		<runtime.websvr.port>80</runtime.websvr.port>
		
		<wildfly.deployment.name>${project.artifactId}.${project.packaging}</wildfly.deployment.name>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.seleniumhq.selenium</groupId>
			<artifactId>selenium-java</artifactId>
			<version>${org.seleniumhq.selenium.version}</version>
			<scope>test</scope>
			<exclusions>
				<!-- exclude this as the dependent xml-apis conflict with the one used by hibernate -->
				<exclusion>
					<groupId>org.seleniumhq.selenium</groupId>
					<artifactId>selenium-htmlunit-driver</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
	</dependencies>
	
	<!-- Build Settings -->
	<build>
		<plugins>
			<!-- provide both default-cli & customized execution -->
			<plugin>
				<groupId>org.wildfly.plugins</groupId>
				<artifactId>wildfly-maven-plugin</artifactId>
				<version>1.0.2.Final</version>
				<configuration>
					<jbossHome>${runtime.appsvr.container.home}</jbossHome>
					<hostname>${runtime.appsvr.configuration.management.hostname}</hostname>
					<port>${runtime.appsvr.configuration.management.port}</port>
					<username>${runtime.appsvr.configuration.management.username}</username>
					<password>${runtime.appsvr.configuration.management.password}</password>
					<name>${wildfly.deployment.name}</name>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<!-- More Project Information -->
	<name>sudoor-server-parent</name>

	<!-- Environment Settings -->
	<issueManagement>
		<system>GitHub</system>
		<url>https://github.com/xfcjscn/sudoor-server-parent/issues</url>
	</issueManagement>
	<scm>
		<connection>scm:git:https://github.com/xfcjscn/sudoor-server-parent.git</connection>
		<developerConnection>scm:git:https://github.com/xfcjscn/sudoor-server-parent.git</developerConnection>
		<url>https://github.com/xfcjscn/sudoor-server-parent</url>
		<tag>1.0.17</tag>
	</scm>

	<profiles>

		<profile>
			<id>test.performance</id>
			<build>
				<plugins>
					<plugin>
						<groupId>com.lazerycode.jmeter</groupId>
						<artifactId>jmeter-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>jmeter-tests</id>
								<phase>verify</phase>
								<goals>
									<goal>jmeter</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>test.integration</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.wildfly.plugins</groupId>
						<artifactId>wildfly-maven-plugin</artifactId>
						<version>1.0.2.Final</version>
						<executions>
							<execution>
								<id>pre-integration-test-deploy-only</id>
								<phase>pre-integration-test</phase>
								<goals>
									<goal>deploy-only</goal>
								</goals>
							</execution>
							<execution>
								<id>post-integration-test-undeploy</id>
								<phase>post-integration-test</phase>
								<goals>
									<goal>undeploy</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-failsafe-plugin</artifactId>
						<configuration>
							<argLine>-Dwebdriver.chrome.driver=${webdriver.chrome.driver} -Druntime.websvr.hostname=${runtime.websvr.hostname} -Druntime.websvr.port=${runtime.websvr.port}</argLine>
						</configuration>
						<executions>
							<execution>
								<goals>
									<goal>integration-test</goal>
									<goal>verify</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<!-- When built in OpenShift the 'openshift' profile will be used when invoking mvn. -->
			<!-- Use this profile for any OpenShift specific customization your app will need. -->
			<!-- By default that is to put the resulting archive into the 'webapps' folder. -->
			<!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html -->
			<id>openshift</id>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-war-plugin</artifactId>
						<version>2.1.1</version>
						<configuration>
							<outputDirectory>webapps</outputDirectory>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		
		<!-- the execution will merge to main build -->
		<profile>
			<id>runtime.appsvr.wildfly.domain</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.wildfly.plugins</groupId>
						<artifactId>wildfly-maven-plugin</artifactId>
						<version>1.0.2.Final</version>
						<configuration>
							<domain>
								<server-groups>
									<server-group>${runtime.appsvr.configuration.domain.server-group}</server-group>
								</server-groups>
							</domain>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>

	</profiles>

</project>
