<?xml version="1.0" encoding="UTF-8"?>
<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>
		<artifactId>openbp-master</artifactId>
		<groupId>org.openbp</groupId>
		<!-- OPENBPVERSION -->
		<version>0.9.11</version>
	</parent>
	<packaging>jar</packaging>

	<groupId>org.openbp</groupId>
	<!-- OPENBPVERSION -->
	<version>0.9.11</version>
	<artifactId>openbp-server</artifactId>
	<name>openbp-server</name>
	<description>The OpenBP process engine (main module)</description>

	<scm>
		<connection>scm:hg:http://bitbucket.org/HeikoErhardt/openbp</connection>
		<developerConnection>scm:hg:https://bitbucket.org/HeikoErhardt/openbp</developerConnection>
		<url>http://bitbucket.org/HeikoErhardt/openbp</url>
	</scm>

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-jar-plugin</artifactId>
				<executions>
					<!-- create a separate artifact containing the test-cases -->
					<execution>
						<id>create-test-jars</id>
						<goals><goal>test-jar</goal></goals>
					</execution>
					<!-- create a separate archive containing the basic ddl files -->
				</executions>
			</plugin>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>sql-maven-plugin</artifactId>

				<!-- jar file that has the jdbc driver -->
				<dependencies>
					<dependency>
						<groupId>${database.groupId}</groupId>
						<artifactId>${database.artifactId}</artifactId>
						<version>${database.version}</version>
					</dependency>
				</dependencies>

				<!-- common configurations -->
				<configuration>
					<driver>${database.driver}</driver>
					<url>${database.url}</url>
					<username>${database.username}</username>
					<autocommit>true</autocommit>
					<skip>${maven.test.skip}</skip>
					<onError>continue</onError>
				</configuration>

				<executions>
					<execution>
						<id>clean-tables</id>
						<phase>process-test-resources</phase>
						<goals>
							<goal>execute</goal>
						</goals>
						<configuration>
							<srcFiles>
								<srcFile>${basedir}/src/main/DDL/${database.type}/Drop-DDL.sql</srcFile>
								<srcFile>${basedir}/src/test/DDL/${database.type}/Drop-DDL-Test.sql</srcFile>
							</srcFiles>
							<onError>continue</onError>
						</configuration>
					</execution>
					<execution>
						<id>create-tables</id>
						<phase>process-test-resources</phase>
						<goals>
							<goal>execute</goal>
						</goals>
						<configuration>
							<srcFiles>
								<srcFile>${basedir}/src/main/DDL/${database.type}/Create-DDL.sql</srcFile>
								<srcFile>${basedir}/src/test/DDL/${database.type}/Create-DDL-Test.sql</srcFile>
							</srcFiles>
							<onError>abort</onError>
						</configuration>
					</execution>
					<execution>
						<id>shutdown-database</id>
						<phase>process-test-resources</phase>
						<goals>
							<goal>execute</goal>
						</goals>
						<configuration>
							<driverProperties>shutdown=true</driverProperties>
							<skipOnConnectionError>true</skipOnConnectionError>
							<skip>${database.skipShutdown}</skip>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<includes>
						<include>**/TestSuiteServer.java</include>
					</includes>
					<systemProperties>
						<!-- Load test case model by file system model manager in basic server test. -->
						<!-- TODO Test 3 Use for test of FileSystemModelMgr
						<property>
							<name>openbp.FileSystemModelMgr.ModelPath</name>
							<value>..\openbp-model-testcase\src\main\resources\model</value>
						</property>
						-->
						<property>
							<name>${database.logParam}</name>
							<value>${database.logValue}</value>
						</property>
					</systemProperties>
				</configuration>
			</plugin>

			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<configuration>
					<descriptors>
						<descriptor>src/main/assemble/ddl.xml</descriptor>
					</descriptors>
				</configuration>
				<executions>
					<execution>
						<id>assemble-ddls</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

		</plugins>
	</build>

	<dependencies>
		<dependency>
			<groupId>org.openbp</groupId>
			<artifactId>openbp-common</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.openbp</groupId>
			<artifactId>openbp-core</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-orm</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-beans</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>com.thoughtworks.xstream</groupId>
			<artifactId>xstream</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.beanshell</groupId>
			<artifactId>bsh</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.quartz-scheduler</groupId>
			<artifactId>quartz</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>commons-codec</groupId>
			<artifactId>commons-codec</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-aspects</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<!-- Required by support of @Configuration -->
			<groupId>cglib</groupId>
			<artifactId>cglib-nodep</artifactId>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<!-- Required by Spring for AspectJ syntax support (pointcuts etc.) -->
			<groupId>org.aspectj</groupId>
			<artifactId>aspectjrt</artifactId>
			<scope>runtime</scope>
		</dependency>

		<dependency>
			<!-- Maps Apache Commons logging (Spring Framework) to SLF4J -->
			<groupId>org.slf4j</groupId>
			<artifactId>jcl104-over-slf4j</artifactId>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>org.openbp</groupId>
			<artifactId>openbp-model-system</artifactId>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>
</project>
