<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.hibernate.ogm</groupId>
        <artifactId>hibernate-ogm-featurepack</artifactId>
        <version>5.4.0.Beta1</version>
    </parent>
    <artifactId>hibernate-ogm-featurepack-base-infinispan</artifactId>
    <packaging>pom</packaging>

    <!-- At the time of writing, Infinispan does not provide a feature pack client modules distribution -->
    <!-- This module can be removed after solving issue: https://issues.jboss.org/browse/ISPN-8689 -->
    <name>Hibernate OGM WildFly Feature Pack - Temporary Infinispan modules Repackaging</name>
    <description>Temporary repackaging of Infinispan modules as a Wildfly feature pack</description>

    <properties>
        <version.com.microsoft.azure.azure-storage>6.1.0</version.com.microsoft.azure.azure-storage>
        <version.net.oauth.core>20090531</version.net.oauth.core>
        <version.org.hibernate.hibernate-search-jbossmodules-engine>5.9.0.Final</version.org.hibernate.hibernate-search-jbossmodules-engine>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.microsoft.azure</groupId>
            <artifactId>azure-storage</artifactId>
            <version>${version.com.microsoft.azure.azure-storage}</version>
            <exclusions>
                <exclusion>
                    <artifactId>*</artifactId>
                    <groupId>*</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>net.oauth.core</groupId>
            <artifactId>oauth</artifactId>
            <version>${version.net.oauth.core}</version>
            <exclusions>
                <exclusion>
                    <artifactId>*</artifactId>
                    <groupId>*</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.infinispan.protostream</groupId>
            <artifactId>protostream</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>*</artifactId>
                    <groupId>*</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-search-jbossmodules-engine</artifactId>
            <version>${version.org.hibernate.hibernate-search-jbossmodules-engine}</version>
            <type>zip</type>
            <exclusions>
                <exclusion>
                    <artifactId>*</artifactId>
                    <groupId>*</groupId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-feature-pack-descriptor</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${feature-pack.dir}</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>src/main/feature-pack-def</directory>
                                    <filtering>true</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.infinispan</groupId>
                                    <artifactId>infinispan-wildfly-modules</artifactId>
                                    <version>${version.org.infinispan}</version>
                                    <type>zip</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${template.dir}</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.wildfly.build</groupId>
                <artifactId>wildfly-feature-pack-build-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>feature-pack-build</id>
                        <goals>
                            <goal>build</goal>
                        </goals>
                        <phase>compile</phase>
                        <configuration>
                            <config-file>feature-pack-template.xml</config-file>
                            <config-dir>${feature-pack.dir}</config-dir>
                            <resourcesDir>/</resourcesDir>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <appendAssemblyId>false</appendAssemblyId>
                    <finalName>${project.artifactId}-${project.version}</finalName>
                    <descriptors>
                        <descriptor>${basedir}/assembly.xml</descriptor>
                    </descriptors>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>