<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>com.holon-platform.jpa</groupId>
		<artifactId>holon-datastore-jpa-root</artifactId>
		<version>5.1.2</version>
	</parent>

	<artifactId>holon-datastore-jpa</artifactId>
	<packaging>jar</packaging>

	<name>${project.groupId}:${project.artifactId}</name>
	<description>Holon Datastore implementation for JPA</description>

	<url>https://holon-platform.com</url>

	<build>
		<plugins>
			<!-- Unit test -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<includes>
						<include>com/holonplatform/datastore/jpa/test/Test*.java</include>
					</includes>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<dependencyManagement>
		<dependencies>

			<!-- Holon Spring platform -->
			<dependency>
				<groupId>com.holon-platform.core</groupId>
				<artifactId>holon-bom-platform</artifactId>
				<version>${holon.core.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>

		</dependencies>
	</dependencyManagement>

	<dependencies>

		<!-- Holon core -->
		<dependency>
			<groupId>com.holon-platform.core</groupId>
			<artifactId>holon-core</artifactId>
			<version>${holon.core.version}</version>
		</dependency>

		<!-- Holon jdbc -->
		<dependency>
			<groupId>com.holon-platform.jdbc</groupId>
			<artifactId>holon-jdbc</artifactId>
			<version>${holon.jdbc.version}</version>
			<exclusions>
				<exclusion>
					<groupId>com.holon-platform.core</groupId>
					<artifactId>holon-core</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- Holon jpa -->
		<dependency>
			<groupId>com.holon-platform.jpa</groupId>
			<artifactId>holon-jpa-bean-processors</artifactId>
			<version>${holon.jpa.version}</version>
			<exclusions>
				<exclusion>
					<groupId>com.holon-platform.core</groupId>
					<artifactId>holon-core</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- JPA API -->
		<dependency>
			<groupId>javax.persistence</groupId>
			<artifactId>javax.persistence-api</artifactId>
			<version>${jpa.api.version}</version>
			<scope>provided</scope>
		</dependency>

		<!-- Test -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.zaxxer</groupId>
			<artifactId>HikariCP</artifactId>
			<version>${hikaricp.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.h2database</groupId>
			<artifactId>h2</artifactId>
			<version>${h2.version}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>jcl-over-slf4j</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>jul-to-slf4j</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>log4j-over-slf4j</artifactId>
			<version>1.7.25</version>
			<scope>test</scope>
		</dependency>

		<!-- Test ORMs -->

		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-core</artifactId>
			<version>${hibernate.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.eclipse.persistence</groupId>
			<artifactId>org.eclipse.persistence.jpa</artifactId>
			<version>${eclipselink.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.openjpa</groupId>
			<artifactId>openjpa</artifactId>
			<version>${openjpa.version}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.datanucleus</groupId>
			<artifactId>datanucleus-core</artifactId>
			<version>${datanucleus.core.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.datanucleus</groupId>
			<artifactId>datanucleus-api-jpa</artifactId>
			<version>${datanucleus.jpa.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.datanucleus</groupId>
			<artifactId>datanucleus-rdbms</artifactId>
			<version>${datanucleus.rdbms.version}</version>
			<scope>test</scope>
		</dependency>

	</dependencies>

	<profiles>
		<profile>
			<id>openjpa</id>
			<build>
				<plugins>
					<!-- Unit test -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<includes>
								<include>com/holonplatform/datastore/jpa/test/OpenJpaTest.java</include>
							</includes>
							<trimStackTrace>false</trimStackTrace>
						</configuration>
					</plugin>
					<!-- OpenJPA entity enhancement -->
					<plugin>
						<groupId>org.apache.openjpa</groupId>
						<artifactId>openjpa-maven-plugin</artifactId>
						<version>${openjpa.version}</version>
						<configuration>
							<includes>**/test/model/oentity/*.class</includes>
							<addDefaultConstructor>true</addDefaultConstructor>
							<persistenceXmlFile>src/test/resources/META-INF/persistence-openjpa.xml</persistenceXmlFile>
						</configuration>
						<executions>
							<execution>
								<id>enhancer</id>
								<phase>process-test-classes</phase>
								<goals>
									<goal>test-enhance</goal>
								</goals>
							</execution>
						</executions>
						<dependencies>
							<dependency>
								<groupId>org.apache.openjpa</groupId>
								<artifactId>openjpa</artifactId>
								<version>${openjpa.version}</version>
							</dependency>
						</dependencies>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>datanucleus</id>
			<build>
				<plugins>
					<!-- Unit test -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<includes>
								<include>com/holonplatform/datastore/jpa/test/DatanucleusTest.java</include>
							</includes>
							<trimStackTrace>false</trimStackTrace>
						</configuration>
					</plugin>
					<!-- Danucleus entity enhancer -->
					<plugin>
						<groupId>org.datanucleus</groupId>
						<artifactId>datanucleus-maven-plugin</artifactId>
						<version>${datanucleus.plugin.version}</version>
						<configuration>
							<api>JPA</api>
							<log4jConfiguration>${project.basedir}/src/test/resources/log4j-datanucleus.properties</log4jConfiguration>
							<persistenceUnitName>test_datanucleus</persistenceUnitName>
						</configuration>
						<executions>
							<execution>
								<phase>process-test-classes</phase>
								<goals>
									<goal>test-enhance</goal>
								</goals>
							</execution>
						</executions>
						<dependencies>
							<dependency>
								<groupId>org.datanucleus</groupId>
								<artifactId>datanucleus-core</artifactId>
								<version>${datanucleus.core.version}</version>
							</dependency>
							<dependency>
								<groupId>org.datanucleus</groupId>
								<artifactId>datanucleus-api-jpa</artifactId>
								<version>${datanucleus.jpa.version}</version>
							</dependency>
						</dependencies>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>