<?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">


    <parent>
        <artifactId>modules-legacy</artifactId>
        <groupId>org.openprovenance.prov</groupId>
        <version>1.0.0</version>
    </parent>


    <modelVersion>4.0.0</modelVersion>
    <artifactId>prov-sql</artifactId>
    <name> |---- PROV-SQL</name>
    <packaging>jar</packaging>
    <description>Java Objects representing the PROV model,  XML serialiser/deserialiser for them, and ORM mapping generated by HyperJaxb.</description>




    <dependencies>

        <dependency>
            <groupId>org.openprovenance.prov</groupId>
            <artifactId>prov-model</artifactId>
            <version>1.0.0</version>
        </dependency>

        <dependency>
            <groupId>org.openprovenance.prov</groupId>
            <artifactId>prov-xml</artifactId>
            <version>1.0.0</version>
        </dependency>

        <dependency>
            <groupId>org.openprovenance.prov</groupId>
            <artifactId>prov-xml</artifactId>
            <version>1.0.0</version>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>


        <!-- jaxb -->

        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
            <version>${jaxb.runtime.version}</version>
        </dependency>

        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <version>${jakarta.xml.bind.version}</version>
        </dependency>

        <!--  JPA Persistence  -->

        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.1-api</artifactId>
            <version>1.0.0.Final</version>
        </dependency>

        <!-- testing -->

        <!--  Hibernate Dependencies  -->

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>${hibernate.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>${hibernate.version}</version>
            <scope>test</scope>
        </dependency>

        <!--  Databases  -->

        <dependency>
            <groupId>org.hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <version>${hsqldb.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>${postgres.version}</version>
            <scope>test</scope>
        </dependency>


    </dependencies>

    <profiles>
        <profile>
            <id>postgres</id>
            <activation>
                <property>
                    <name>postgres</name>
                </property>
            </activation>
            <properties>
                <persistence.properties>persistence.postgres.properties</persistence.properties>
            </properties>

        </profile>

        <profile>
            <id>hsqldb</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <persistence.properties>persistence.hsqldb.properties</persistence.properties>
            </properties>
        </profile>
    </profiles>


    <build>




        <plugins>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <additionalOptions>
                        <additionalOption>-Xdoclint:none</additionalOption>
                    </additionalOptions>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.3.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>9</source>
                    <target>9</target>
                </configuration>
            </plugin>

        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>hibernate3-maven-plugin</artifactId>
                    <version>${hibernate3.plugin.version}</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <configuration>
                                <hibernatetool destdir="${project.build.directory}/hibernate">
                                    <classpath>
                                        <path location="${project.build.directory}/classes" />
                                        <path location="${project.build.directory}/test-classes" />
                                    </classpath>
                                    <jpaconfiguration persistenceunit="org.openprovenance.prov.sql" propertyfile="${project.build.directory}/test-classes/persistence.hsqldb.properties" />
                                    <hbm2doc />
                                    <!-- <hbm2hbmxml /> -->
                                    <hbm2ddl outputfilename="sql.ddl" />

                                </hibernatetool>
                            </configuration>
                            <goals>
                                <goal>run</goal>
                            </goals>
                        </execution>


                        <execution>
                            <id>default-cli</id>
                            <configuration>
                                <hibernatetool destdir="${project.build.directory}/site/hibernate">
                                    <classpath>
                                        <path location="${project.build.directory}/classes" />
                                        <path location="${project.build.directory}/test-classes" />
                                    </classpath>
                                    <jpaconfiguration persistenceunit="org.openprovenance.prov.sql" propertyfile="${project.build.directory}/test-classes/persistence.hsqldb.properties" />
                                    <hbm2doc />
                                    <!-- <hbm2hbmxml /> -->
                                    <hbm2ddl outputfilename="sql.ddl" />

                                </hibernatetool>
                            </configuration>
                            <goals>
                                <goal>run</goal>
                            </goals>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.ant</groupId>
                            <artifactId>ant</artifactId>
                            <version>1.10.14</version>
                        </dependency>

                        <dependency>
                            <groupId>org.hibernate</groupId>
                            <artifactId>hibernate-core</artifactId>
                            <version>${hibernate.version}</version>
                        </dependency>

                        <dependency>
                            <groupId>org.hibernate</groupId>
                            <artifactId>hibernate-tools</artifactId>
                            <version>4.3.1.Final</version>
                        </dependency>

                        <dependency>
                            <groupId>org.hsqldb</groupId>
                            <artifactId>hsqldb</artifactId>
                            <version>${hsqldb.version}</version>
                        </dependency>

                        <dependency>
                            <groupId>org.postgresql</groupId>
                            <artifactId>postgresql</artifactId>
                            <version>${postgres.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>


        </pluginManagement>


        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>




    </build>

</project>
