<!--
/******************************************************************************
 * Vige, Home of Professional Open Source Copyright 2010, Vige, and           *
 * individual contributors by the @authors tag. See the copyright.txt in the  *
 * distribution for a full listing of individual contributors.                *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may    *
 * not use this file except in compliance with the License. You may obtain    *
 * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0        *
 * Unless required by applicable law or agreed to in writing, software        *
 * distributed under the License is distributed on an "AS IS" BASIS,          *
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   *
 * See the License for the specific language governing permissions and        *
 * limitations under the License.                                             *
 ******************************************************************************/
-->
<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>it.vige</groupId>
		<artifactId>school-app</artifactId>
		<version>1.2.2</version>
	</parent>

	<artifactId>school-app-ejb</artifactId>
	<packaging>ejb</packaging>
	<name>School Application EJB</name>
	<description>School Application EJB</description>

	<build>
		<defaultGoal>package</defaultGoal>
		<finalName>school</finalName>
		<plugins>
			<plugin>
				<artifactId>maven-ejb-plugin</artifactId>
				<version>${maven.ejb.plugin.version}</version>
				<configuration>
					<generateClient>false</generateClient>
					<ejbVersion>${ejb.version}</ejbVersion>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>development</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>com.google.code.maven-replacer-plugin</groupId>
						<artifactId>replacer</artifactId>
						<version>${maven.replacer.plugin.version}</version>
						<executions>
							<execution>
								<phase>prepare-package</phase>
								<goals>
									<goal>replace</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<file>${project.build.directory}/classes/META-INF/persistence.xml</file>
							<replacements>
								<replacement>
									<token>MAVEN_REPLACER_HBM2DDL_AUTO</token>
									<value>drop-and-create</value>
								</replacement>
							</replacements>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>production</id>
			<build>
				<plugins>
					<plugin>
						<groupId>com.google.code.maven-replacer-plugin</groupId>
						<artifactId>replacer</artifactId>
						<version>${maven.replacer.plugin.version}</version>
						<executions>
							<execution>
								<phase>prepare-package</phase>
								<goals>
									<goal>replace</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<file>${project.build.directory}/classes/META-INF/persistence.xml</file>
							<replacements>
								<replacement>
									<token>MAVEN_REPLACER_HBM2DDL_AUTO</token>
									<value>create</value>
								</replacement>
							</replacements>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>