<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/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>nz.co.senanque</groupId>
		<artifactId>madura-workflows</artifactId>
		<version>2.3.0</version>
	</parent>
	<artifactId>madura-workflow</artifactId>
	<name>MaduraWorkflow</name>
	<description>Workflow engine that integrates Madura.</description>
	<organization>
		<name>Prometheus Consulting</name>
		<url>www.madurasoftware.com</url>
	</organization>
	<developers>
		<developer>
			<id>roger</id>
			<name>Roger J Parkinson</name>
			<email>roger.parkinson35 at gmail.com</email>
			<timezone>GMT+12</timezone>
			<roles>
			</roles>
		</developer>
	</developers>
	<properties>
		<sql>${project.artifactId}-${project.version}</sql>
	</properties>
	<dependencies>
		<dependency>
			<groupId>com.h2database</groupId>
			<artifactId>h2</artifactId>
			<version>1.3.175</version>
			<scope>test</scope>
		</dependency>
		<dependency>
		    <groupId>mysql</groupId>
		    <artifactId>mysql-connector-java</artifactId>
		    <version>5.1.29</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>com.atomikos</groupId>
			<artifactId>transactions-hibernate3</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-orm</artifactId>
			<version>${spring.framework.version}</version>
			<exclusions>
				<exclusion>
					<artifactId>commons-logging</artifactId>
					<groupId>commons-logging</groupId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-aspects</artifactId>
			<version>${spring.framework.version}</version>
			<exclusions>
				<exclusion>
					<artifactId>commons-logging</artifactId>
					<groupId>commons-logging</groupId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<artifactId>spring-aop</artifactId>
			<groupId>org.springframework</groupId>
		</dependency>
		<dependency>
			<groupId>org.springframework.integration</groupId>
			<artifactId>spring-integration-core</artifactId>
			<version>${spring.framework.integration.version}</version>
			<exclusions>
				<exclusion>
					<artifactId>spring-aop</artifactId>
					<groupId>org.springframework</groupId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-messaging</artifactId>
			<version>${spring.framework.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.integration</groupId>
			<artifactId>spring-integration-xml</artifactId>
			<version>${spring.framework.integration.version}</version>
			<exclusions>
				<exclusion>
					<artifactId>commons-logging</artifactId>
					<groupId>commons-logging</groupId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework.integration</groupId>
			<artifactId>spring-integration-ws</artifactId>
			<version>${spring.framework.integration.version}</version>
			<exclusions>
				<exclusion>
					<artifactId>commons-logging</artifactId>
					<groupId>commons-logging</groupId>
				</exclusion>
				<exclusion>
					<artifactId>spring-aop</artifactId>
					<groupId>org.springframework</groupId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework.integration</groupId>
			<artifactId>spring-integration-stream</artifactId>
			<version>${spring.framework.integration.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.integration</groupId>
			<artifactId>spring-integration-jdbc</artifactId>
			<version>${spring.framework.integration.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-oxm</artifactId>
			<version>${spring.framework.version}</version>
			<exclusions>
				<exclusion>
					<artifactId>commons-logging</artifactId>
					<groupId>commons-logging</groupId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>nz.co.senanque</groupId>
			<artifactId>madura-rules</artifactId>
		</dependency>
		<dependency>
			<groupId>nz.co.senanque</groupId>
			<artifactId>madura-test-webservice</artifactId>
			<version>${project.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
  		<dependency>
		    <groupId>org.hibernate</groupId>
		    <artifactId>hibernate-entitymanager</artifactId>
		    <scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.data</groupId>
			<artifactId>spring-data-jpa</artifactId>
			<version>${spring.framework.data.version}</version>
			<scope>test</scope>
			<exclusions>
				<exclusion>
					<groupId>org.slf4j</groupId>
					<artifactId>slf4j-api</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.slf4j</groupId>
					<artifactId>jcl-over-slf4j</artifactId>
				</exclusion>
				<exclusion>
					<artifactId>spring-aop</artifactId>
					<groupId>org.springframework</groupId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework.integration</groupId>
			<artifactId>spring-integration-jmx</artifactId>
			<version>${spring.framework.integration.version}</version>
		</dependency>
		<dependency>
		    <groupId>org.hibernate.javax.persistence</groupId>
		    <artifactId>hibernate-jpa-2.1-api</artifactId>
		    <version>1.0.0.Final</version>
		</dependency>
		<dependency>
			<groupId>org.jvnet.hyperjaxb3</groupId>
			<artifactId>hyperjaxb3-ejb-runtime</artifactId>
		</dependency>
		<dependency>
			<groupId>org.jvnet.hyperjaxb3</groupId>
			<artifactId>hyperjaxb3-ejb-plugin</artifactId>
			<exclusions>
				<exclusion>
					<artifactId>hibernate-jpa-2.0-api</artifactId>
					<groupId>org.hibernate.javax.persistence</groupId>
				</exclusion>
				<exclusion>
					<groupId>commons-logging</groupId>
					<artifactId>commons-logging</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.jvnet.hyperjaxb3</groupId>
					<artifactId>hyperjaxb3-ejb-roundtrip</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.springframework</groupId>
					<artifactId>spring</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.slf4j</groupId>
					<artifactId>slf4j-log4j12</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
	</dependencies>

	<build>
		<defaultGoal>install</defaultGoal>
 		<resources>
			<resource>
				<directory>generated-sources/xjc</directory>
				<includes>
					<include>**/*.properties</include>
					<include>**/*.xml</include>
				</includes>
				<filtering>false</filtering>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>nz.co.senanque</groupId>
				<artifactId>schema-translator-maven-plugin</artifactId>
				<version>1.0.0</version>
				<executions>
					<execution>
						<id>sql-generate-h2</id>
						<phase>package</phase>
						<goals>
							<goal>sql</goal>
						</goals>
						<configuration>
							<persistenceFile>${basedir}/src/main/resources/META-INF/persistence-workflow.xml</persistenceFile>
							<persistenceUnit>pu-workflow</persistenceUnit>
							<dialect>org.hibernate.dialect.H2Dialect</dialect>
							<drops>false</drops>
							<destFile>${sql}.H2.sql</destFile>
						</configuration>
					</execution>
					<execution>
						<id>sql-generate-postgres</id>
						<phase>package</phase>
						<goals>
							<goal>sql</goal>
						</goals>
						<configuration>
							<persistenceFile>${basedir}/src/main/resources/META-INF/persistence-workflow.xml</persistenceFile>
							<persistenceUnit>pu-workflow</persistenceUnit>
							<dialect>org.hibernate.dialect.MySQL5InnoDBDialect</dialect>
							<drops>false</drops>
							<destFile>${sql}.mysql.sql</destFile>
						</configuration>
					</execution>
				</executions>
				<dependencies>
					<!-- Need this because the entity classes refer to items in MaduraObjects -->
					<dependency>
						<groupId>nz.co.senanque</groupId>
						<artifactId>madura-objects</artifactId>
						<version>3.0.0</version>
					</dependency>
				</dependencies>
			</plugin>
			<plugin>
			  <groupId>org.apache.maven.plugins</groupId>
			  <artifactId>maven-failsafe-plugin</artifactId>
			  <version>2.19.1</version>
				<configuration>
					<includes>
						<include>**/WorkflowWithRules2Test.java</include>
					</includes>
				</configuration>
			  <executions>
			    <execution>
			      <id>integration-test</id>
			      <goals>
			        <goal>integration-test</goal>
			      </goals>
			    </execution>
			    <execution>
			      <id>verify</id>
			      <goals>
			        <goal>verify</goal>
			      </goals>
			    </execution>
			  </executions>
			</plugin>
			<plugin>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.7.1</version>
				<executions>
					<execution>
						<id>default-test</id>
						<phase>test</phase>
						<goals>
							<goal>test</goal>
						</goals>
						<configuration>
							<excludes>
								<exclude>**/AtomikosTest.java</exclude>
								<exclude>**/ScheduledTaskTest.java</exclude>
								<exclude>**/DatabaseTest.java</exclude>
								<!--<exclude>**/WorkflowManagerImplTest.java</exclude> -->
								<exclude>**/WorkflowRetryTest.java</exclude>
								<exclude>**/WorkflowWithRulesTest.java</exclude>
								<exclude>**/WorkflowWithRules2Test.java</exclude>
							</excludes>
							<includes>
								<!-- this runs from Eclipse but not from maven -->
								<!--<include>**/WorkflowTests.java</include> -->
							</includes>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>nz.co.senanque</groupId>
				<artifactId>madura-objects-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>base</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>generate</goal>
						</goals>
						<configuration>
							<schemaIncludes>
								<include>Workflow.xsd</include>
							</schemaIncludes>
							<schemaDirectory>src/main/resources/</schemaDirectory>
							<addCompileSourceRoot>true</addCompileSourceRoot>
							<generateDirectory>generated-sources/xjc</generateDirectory>
						</configuration>
					</execution>
					<execution>
						<id>test</id>
						<phase>generate-test-sources</phase>
						<goals>
							<goal>generate</goal>
						</goals>
						<configuration>
							<schemaIncludes>
								<include>TestInstances.xsd</include>
							</schemaIncludes>
							<generateDirectory>generated-test-sources/xjc</generateDirectory>
							<addTestCompileSourceRoot>true</addTestCompileSourceRoot>
							<schemaDirectory>src/test/resources/</schemaDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>1.5</version>
				<executions>
					<execution>
						<id>add-source</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>generated-sources/xjc/</source>
							</sources>
						</configuration>
					</execution>
					<execution>
						<id>add-resource</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>add-resource</goal>
						</goals>
						<configuration>
							<resources>
								<resource>
									<directory>generated-sources/xjc/</directory>
								</resource>
							</resources>
						</configuration>
					</execution>
					<execution>
						<id>add-test-source</id>
						<phase>generate-test-sources</phase>
						<goals>
							<goal>add-test-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>generated-test-sources/xjc/</source>
							</sources>
						</configuration>
					</execution>
					<execution>
						<phase>package</phase>
						<id>attach-artifacts</id>
						<goals>
							<goal>attach-artifact</goal>
						</goals>
						<configuration>
							<artifacts>
								<artifact>
									<file>${pdf}</file>
									<type>pdf</type>
								</artifact>
								<artifact>
									<file>target/${sql}.H2.sql</file>
									<type>H2.sql</type>
								</artifact>
							</artifacts>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<version>2.4.3</version>
				<executions>
					<execution>
						<id>default-resources</id>
						<phase>process-resources</phase>
						<goals>
							<goal>resources</goal>
						</goals>
					</execution>
					<execution>
						<id>default-testResources</id>
						<phase>process-test-resources</phase>
						<goals>
							<goal>testResources</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
			</plugin>

			<plugin>
				<groupId>nz.co.senanque</groupId>
				<artifactId>maduradocs</artifactId>
				<version>${maduradocs.version}</version>
				<executions>
					<execution>
						<goals>
							<goal>pdf</goal>
						</goals>
					</execution>
				</executions>
			</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>nz.co.senanque</groupId>
									<artifactId>
										madura-objects-maven-plugin
									</artifactId>
									<versionRange>
										[3.0.0,)
									</versionRange>
									<goals>
										<goal>generate</goal>
									</goals>
								</pluginExecutionFilter>
								<action>
									<ignore />
								</action>
							</pluginExecution>
							<pluginExecution>
								<pluginExecutionFilter>
									<groupId>org.codehaus.mojo</groupId>
									<artifactId>
										build-helper-maven-plugin
									</artifactId>
									<versionRange>[1.5,)</versionRange>
									<goals>
										<goal>add-resource</goal>
										<goal>add-source</goal>
									</goals>
								</pluginExecutionFilter>
								<action>
									<ignore />
								</action>
							</pluginExecution>
							<pluginExecution>
								<pluginExecutionFilter>
									<groupId>
										org.kuali.maven.plugins
									</groupId>
									<artifactId>
										properties-maven-plugin
									</artifactId>
									<versionRange>
										[1.1.9,)
									</versionRange>
									<goals>
										<goal>
											read-project-properties
										</goal>
									</goals>
								</pluginExecutionFilter>
								<action>
									<ignore />
								</action>
							</pluginExecution>
						</pluginExecutions>
					</lifecycleMappingMetadata>
				</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	<profiles>
		<profile>
			<id>release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>1.5</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>1.6.3</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://oss.sonatype.org/</nexusUrl>
							<autoReleaseAfterClose>true</autoReleaseAfterClose>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>