<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>
		<artifactId>ars</artifactId>
		<groupId>gov.va.med.cds</groupId>
		<version>4.0.2-SNAPSHOT</version>
		<relativePath>../pom.xml</relativePath>
	</parent>
	<modelVersion>4.0.0</modelVersion>
	<artifactId>ars-ear</artifactId>
	<name>ARS: ars-ear</name>
	<packaging>ear</packaging>
	<description>
		Aggregate Reporting Service Enterprise Deployment Module
	</description>
	<properties>
		<earFileName>${artifactId}-${project.version}</earFileName>
		<ars.deploy.bounce.weblogic>False</ars.deploy.bounce.weblogic>
	</properties>
	<dependencies>
		<dependency>
			<groupId>gov.va.med.cds</groupId>
			<artifactId>reporting-service</artifactId>
			<type>ejb</type>
		</dependency>
		<dependency>
			<groupId>gov.va.med.cds</groupId>
			<artifactId>ars-log4j-configuration</artifactId>
			<type>jar</type>
		</dependency>
  	</dependencies>
  <profiles>
		<profile>
			<!-- 
			  Profile for stopping and starting the server that is being deployed to. 
			-->
			<id>bounce-weblogic</id>	
			<properties>
				<ars.deploy.bounce.weblogic>True</ars.deploy.bounce.weblogic>
			</properties>
		</profile>
	</profiles>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-ear-plugin</artifactId>
				<configuration>
					<defaultJavaBundleDir>
						APP-INF/lib
					</defaultJavaBundleDir>
					<finalName>${earFileName}</finalName>
					<version>1.4</version>
				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>exec-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>Deploy ARS EAR</id>
						<phase>install</phase>
						<goals>
							<goal>exec</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<!--
					<executable>${WEBLOGIC_HOME}/common/bin/${weblogic.wlst}</executable>
					-->
					<executable>java</executable>
					<includePluginDependencies>true</includePluginDependencies>
					<arguments>
						<!--
						<argument>./src/main/resources/wlst/ars-deploy-main.py</argument>
						<argument>${cds.run.properties.path}</argument>
						<argument>${ars.deploy.bounce.weblogic}</argument>
						<argument>${earFileName}</argument>
						<argument>${project.build.directory}/${earFileName}.ear</argument>
						-->
						<argument>-classpath</argument>
						<argument>${WEBLOGIC_HOME}/server/lib/weblogic.jar</argument>
						<argument>weblogic.WLST</argument>
						<argument>./src/main/resources/wlst/ars-deploy-main.py</argument>
						<!-- argument>${cds.run.properties.path}</argument -->
						<argument>${ars.deploy.bounce.weblogic}</argument>
						<argument>${earFileName}</argument>
						<argument>${project.build.directory}/${earFileName}.ear</argument>
						<argument>${cds.appserver.admin.username}</argument>
						<argument>${cds.appserver.admin.password}</argument>
						<argument>${cds.appserver.admin.url}</argument>
						<argument>${cds.appserver.target.server}</argument>
						<argument>${cds.appserver.domainname}</argument>
						<argument>${cds.nmPort}</argument>
						<argument>${cds.appserver.domaindir}</argument>
					</arguments>
				</configuration>

			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.apache.maven.plugins
										</groupId>
										<artifactId>
											maven-ear-plugin
										</artifactId>
										<versionRange>
											[2.4.2,)
										</versionRange>
										<goals>
											<goal>
												generate-application-xml
											</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
</project>
