<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>org.janusgraph</groupId>
        <artifactId>janusgraph</artifactId>
        <version>0.5.1</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <artifactId>janusgraph-hbase-parent</artifactId>
    <packaging>pom</packaging>
    <name>JanusGraph-HBase: Parent Module</name>
    <url>https://janusgraph.org</url>
    
    <modules>
        <module>janusgraph-hbase-core</module>
        <module>janusgraph-hbase-server</module>
        <module>janusgraph-hbase-10</module>
        <module>janusgraph-hbase</module>
    </modules>
    
    <properties>
        <janusgraph.hbase.mvn.opts>-Dhadoop.version=${hadoop.version} -Dhadoop.profile=${hadoop.profile} ${janusgraph.hbase.mvn.opts.extra}</janusgraph.hbase.mvn.opts>
        <janusgraph.hbase.mvn.opts.extra />
        <default.test.jvm.opts>-Xms256m -Xmx1280m -XX:+HeapDumpOnOutOfMemoryError -ea ${test.extra.jvm.opts}</default.test.jvm.opts>
        <mem.jvm.opts>-Xms256m -Xmx768m -ea -XX:+HeapDumpOnOutOfMemoryError ${test.extra.jvm.opts}</mem.jvm.opts>
        <top.level.basedir>${project.parent.basedir}</top.level.basedir>
    </properties>
    
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>filter-hbase-conf</id>
                            <phase>process-test-resources</phase>
                            <goals>
                                <goal>copy-resources</goal>
                            </goals>
                            <configuration>
                                <outputDirectory>${project.basedir}/conf</outputDirectory>
                                <delimiters>
                                    <delimiter>$MAVEN{*}</delimiter>
                                </delimiters>
                                <resources>
                                    <resource>
                                        <directory>${project.basedir}/../common/test/conf/</directory>
                                        <filtering>true</filtering>
                                    </resource>
                                </resources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <test.hbase.parentdir>${top.level.basedir}/janusgraph-hbase-parent</test.hbase.parentdir>
                            </systemPropertyVariables>
                        <excludedGroups>${test.excluded.groups}</excludedGroups>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>generate-cached-classpath</id>
                            <phase>generate-test-resources</phase>
                            <goals>
                                <goal>build-classpath</goal>
                            </goals>
                            <configuration>
                                <outputFile>${project.basedir}/target/cached_classpath.txt</outputFile>
                            </configuration>
                        </execution>
                        <execution>
                            <id>unpack-common-test-classes</id>
                            <phase>process-test-classes</phase>
                            <goals>
                                <goal>unpack</goal>
                            </goals>
                            <configuration>
                                <artifactItems>
                                    <artifactItem>
                                        <groupId>${project.groupId}</groupId>
                                        <artifactId>janusgraph-hbase-core</artifactId>
                                        <version>${project.version}</version>
                                        <classifier>tests</classifier>
                                        <outputDirectory>${project.build.directory}/test-classes</outputDirectory>
                                    </artifactItem>
                                </artifactItems>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <!-- Using assembly instead of resources because resources breaks filemodes and 
                         permissions: http://jira.codehaus.org/browse/MRESOURCES-132 -->
                    <artifactId>maven-assembly-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>copy-hbase-bin</id>
                            <phase>process-test-resources</phase>
                            <goals>
                                <goal>single</goal>
                            </goals>
                            <configuration>
                                <appendAssemblyId>false</appendAssemblyId>
                                <finalName>/</finalName>
                                <attach>false</attach>
                                <outputDirectory>${project.basedir}/bin</outputDirectory>
                                <descriptors>
                                    <descriptor>${project.basedir}/../common/test/binassembly.xml</descriptor>
                                </descriptors>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>clean-hbase-files</id>
                            <phase>clean</phase>
                            <goals>
                                <goal>clean</goal>
                            </goals>
                            <configuration>
                                <excludeDefaultDirectories>true</excludeDefaultDirectories>
                                <filesets>
                                    <fileset>
                                        <directory>bin/</directory>
                                    </fileset>
                                    <fileset>
                                        <directory>conf/</directory>
                                    </fileset>
                                    <fileset>
                                        <directory>logs/</directory>
                                    </fileset>
                                </filesets>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>
