<!--
 ~ Hibernate OGM, Domain model persistence for NoSQL datastores
 ~
 ~ License: GNU Lesser General Public License (LGPL), version 2.1 or later
 ~ See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
  -->
<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.hibernate.ogm</groupId>
        <artifactId>hibernate-ogm-modules</artifactId>
        <version>4.1.0.Beta7</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>hibernate-ogm-modules-eap6</artifactId>
    <packaging>pom</packaging>

    <name>Hibernate OGM EAP Module</name>
    <description>A module for adding OGM to EAP</description>

    <properties>
        <luceneVersion>3.6.2</luceneVersion>
        <lucene.module.slot>main</lucene.module.slot>
        <assembly.finalName>${project.artifactId}6-${project.version}</assembly.finalName>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>hibernate-ogm-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.hibernate.hql</groupId>
            <artifactId>hibernate-hql-parser</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate.hql</groupId>
            <artifactId>hibernate-hql-lucene</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
        </dependency>
       <dependency>
            <groupId>org.hibernate.ogm</groupId>
            <artifactId>hibernate-ogm-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate.ogm</groupId>
            <artifactId>hibernate-ogm-infinispan</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate.ogm</groupId>
            <artifactId>hibernate-ogm-ehcache</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate.ogm</groupId>
            <artifactId>hibernate-ogm-mongodb</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate.ogm</groupId>
            <artifactId>hibernate-ogm-neo4j</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate.ogm</groupId>
            <artifactId>hibernate-ogm-couchdb</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate.common</groupId>
            <artifactId>hibernate-commons-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-search-orm</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-search-engine</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-search-infinispan</artifactId>
        </dependency>
        <dependency>
            <groupId>org.infinispan</groupId>
            <artifactId>infinispan-lucene-directory</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-infinispan</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.1-api</artifactId>
        </dependency>
    </dependencies>

    <build>
        <extensions>
            <extension>
                <!-- Allows maven-external-dependency-plugin to follow HTTP re-directs -->
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-http-lightweight</artifactId>
                <version>2.2</version>
            </extension>
        </extensions>
        <plugins>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <appendAssemblyId>false</appendAssemblyId>
                </configuration>
            </plugin>
            <!-- The following three plug-ins retrieve the RESTEasy distribution via
                HTTP and install it into the local repo (if not present yet) and unzip the
                module ZIP from the distribution so we can re-pack it into our own module
                ZIP for EAP; That will be not necessary once the RESTeasy module ZIP itself
                can be obtained as dependency via Maven -->
            <plugin>
                <groupId>com.savage7.maven.plugins</groupId>
                <artifactId>maven-external-dependency-plugin</artifactId>
                <inherited>false</inherited>
                <configuration>
                    <stagingDirectory>
                        ${project.build.directory}/dependencies/
                    </stagingDirectory>
                    <createChecksum>true</createChecksum>
                    <skipChecksumVerification>false</skipChecksumVerification>
                    <force>false</force>
                    <artifactItems>
                        <artifactItem>
                            <groupId>org.jboss.resteasy</groupId>
                            <artifactId>resteasy-dist</artifactId>
                            <version>${resteasyVersion}</version>
                            <packaging>zip</packaging>
                            <downloadUrl>
                                http://sourceforge.net/projects/resteasy/files/Resteasy%20JAX-RS/${resteasyVersion}/resteasy-jaxrs-${resteasyVersion}-all.zip/download
                            </downloadUrl>
                        </artifactItem>
                    </artifactItems>
                </configuration>
                <executions>
                    <execution>
                        <id>clean-external-dependencies</id>
                        <phase>clean</phase>
                        <goals>
                            <goal>clean-external</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>resolve-install-external-dependencies</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>resolve-external</goal>
                            <goal>install-external</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack-resteasy-dist</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.jboss.resteasy</groupId>
                                    <artifactId>resteasy-dist</artifactId>
                                    <version>${resteasyVersion}</version>
                                    <type>zip</type>
                                    <overWrite>false</overWrite>
                                    <outputDirectory>${project.build.directory}/unpacked-dependencies</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack-resteasy-modules</id>
                        <phase>process-resources</phase>
                        <configuration>
                            <tasks>
                                <echo message="Unpacking RESTEasy modules ZIP" />
                                <unzip src="${project.build.directory}/unpacked-dependencies/resteasy-jaxrs-${resteasyVersion}/resteasy-jboss-modules-${resteasyVersion}.zip" dest="${project.build.directory}/unpacked-resteasy-modules" />
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
