<?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.8</version>
	</parent>
	<packaging>jar</packaging>

	<groupId>org.openbp</groupId>
	<!-- OPENBPVERSION -->
	<version>0.9.8</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>org.apache.derby</groupId>
						<artifactId>derby</artifactId>
						<version>10.4.1.3</version>
					</dependency>
					<dependency>
						<groupId>org.hsqldb</groupId>
						<artifactId>hsqldb</artifactId>
						<version>2.0.0</version>
					</dependency>
				</dependencies>

				<!-- common configurations -->
				<configuration>
					<!--
					<driver>org.apache.derby.jdbc.EmbeddedDriver</driver>
					<url>jdbc:derby:${basedir}/../openbp-derby/target/work/openbptestcase;create=true</url>
					-->
					<driver>org.hsqldb.jdbcDriver</driver>
					<url>jdbc:hsqldb:file:${basedir}/../openbp-hsql/target/work/openbptestcase</url>
					<username>sa</username>

					<autocommit>true</autocommit>
					<skip>${maven.test.skip}</skip>
					<onError>continue</onError>
				</configuration>

				<executions>
					<execution>
						<id>clean-tables</id>
						<phase>process-resources</phase>
						<goals>
							<goal>execute</goal>
						</goals>
						<configuration>
							<fileset>
								<basedir>${basedir}/src/main/DDL/${database.type}</basedir>
								<includes>
									<include>Drop-DDL.sql</include>
								</includes>
							</fileset>
							<onError>continue</onError>
						</configuration>
					</execution>
					<execution>
						<id>clean-test-tables</id>
						<phase>process-test-resources</phase>
						<goals>
							<goal>execute</goal>
						</goals>
						<configuration>
							<fileset>
								<basedir>${basedir}/src/test/DDL/${database.type}</basedir>
								<includes>
									<include>Drop-DDL-Test.sql</include>
								</includes>
							</fileset>
							<onError>continue</onError>
						</configuration>
					</execution>
					<execution>
						<id>create-tables</id>
						<phase>process-resources</phase>
						<goals>
							<goal>execute</goal>
						</goals>
						<configuration>
							<fileset>
								<basedir>${basedir}/src/main/DDL/${database.type}</basedir>
								<includes>
									<include>Create-DDL.sql</include>
								</includes>
							</fileset>
							<onError>abort</onError>
						</configuration>
					</execution>
					<execution>
						<id>create-test-tables</id>
						<phase>process-test-resources</phase>
						<goals>
							<goal>execute</goal>
						</goals>
						<configuration>
							<fileset>
								<basedir>${basedir}/src/test/DDL/${database.type}</basedir>
								<includes>
									<include>Create-DDL-Test.sql</include>
								</includes>
							</fileset>
							<onError>abort</onError>
						</configuration>
					</execution>
					<execution>
						<id>shutdown-derby</id>
						<phase>process-test-resources</phase>
						<goals>
							<goal>execute</goal>
						</goals>
						<configuration>
							<url>jdbc:derby:${basedir}/../openbp-derby/target/work/openbptestcase;shutdown=true</url>
							<skipOnConnectionError>true</skipOnConnectionError>
						</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. -->
						<property>
							<name>openbp.FileSystemModelMgr.ModelPath</name>
							<value>..\openbp-model-testcase\src\main\resources\model</value>
						</property>
						<property>
							<name>derby.stream.error.file</name>
							<value>target/logs/OpenBP-Derby.log</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>
		<!-- Test case is being loaded by file system model manager, so we comment out this dependency here.
		<dependency>
			<groupId>org.openbp</groupId>
			<artifactId>openbp-model-testcase</artifactId>
			<scope>test</scope>
		</dependency>
		-->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>
</project>
