<?xml version="1.0"?>
<project
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>de.alpharogroup</groupId>
		<artifactId>application.db.modules</artifactId>
		<version>2.2.0</version>
	</parent>

	<artifactId>address.book</artifactId>

	<name>address.book</name>

	<url>http://maven.apache.org</url>

	<dependencies>

		<dependency>
			<groupId>de.alpharogroup</groupId>
			<artifactId>dao.api</artifactId>
		</dependency>

		<dependency>
			<groupId>de.alpharogroup</groupId>
			<artifactId>jaulp.xml</artifactId>
		</dependency>

		<dependency>
			<groupId>de.alpharogroup</groupId>
			<artifactId>jgeohash</artifactId>
		</dependency>

		<dependency>
			<groupId>de.alpharogroup</groupId>
			<artifactId>randomizer</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>de.alpharogroup</groupId>
			<artifactId>jaulp.file</artifactId>
		</dependency>

		<dependency>
			<groupId>p6spy</groupId>
			<artifactId>p6spy</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.apache.tomcat</groupId>
			<artifactId>tomcat-dbcp</artifactId>
			<scope>test</scope>
		</dependency>


		<dependency>
			<groupId>org.apache.tomcat</groupId>
			<artifactId>tomcat-jdbc</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<inherited>true</inherited>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
			</plugin>

			<!-- Configuring Maven Source Plugin: To attach source artifacts to your 
				build we execute the source:jar goal from the source plugin during the package 
				phase. -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-eclipse-plugin</artifactId>
			</plugin>

		</plugins>
	</build>

	<profiles>

		<profile>
			<id>createdb</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>

			<build>
				<plugins>

					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>properties-maven-plugin</artifactId>
					</plugin>

					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>hibernate3-maven-plugin</artifactId>
						<configuration>
							<components>
								<component>
									<name>hbm2ddl</name>
									<implementation>jpaconfiguration</implementation>
								</component>
							</components>
							<componentProperties>
								<drop>true</drop>
								<!-- optional, but useful for later inspection -->
								<outputfilename>schema.ddl</outputfilename>
								<persistenceunit>addressbook</persistenceunit>
							</componentProperties>
						</configuration>
					</plugin>

					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>sql-maven-plugin</artifactId>

						<!-- configurations for the jdbc drivers -->
						<configuration>
							<driver>${jdbc.driver}</driver>
							<url>${jdbc.base.url}${jdbc.db.name}</url>
							<username>${jdbc.user}</username>
							<password>${jdbc.password}</password>
						</configuration>
					</plugin>

					<!--This plugin is used to execute java classes with a main method. -->
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>exec-maven-plugin</artifactId>
						<executions>
							<execution>
								<goals>
									<goal>java</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<mainClass>address.book.init.InitializeDbAddressbook</mainClass>
							<arguments>
								<argument>delete</argument>
							</arguments>
						</configuration>
					</plugin>

				</plugins>

			</build>

		</profile>

	</profiles>

</project>
