<?xml version='1.0' encoding='UTF-8'?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.infinispan</groupId>
        <artifactId>infinispan-lucene-parent</artifactId>
        <version>9.2.2.Final</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>infinispan-directory-provider</artifactId>
    <name>Infinispan Directory Provider for Hibernate Search</name>
    <description>Infinispan Storage for Hibernate Search</description>

    <dependencies>
        <dependency>
            <groupId>org.infinispan</groupId>
            <artifactId>infinispan-lucene-directory</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-search-engine</artifactId>
        </dependency>

        <!-- test -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-testing</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.jboss.byteman</groupId>
                    <artifactId>byteman-install</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.jboss.byteman</groupId>
                    <artifactId>byteman</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.jboss.byteman</groupId>
                    <artifactId>byteman-bmunit</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-search-engine</artifactId>
            <version>${version.hibernate.search}</version>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-search-orm</artifactId>
            <version>${version.hibernate.search}</version>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-search-orm</artifactId>
            <version>${version.hibernate.search}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.byteman</groupId>
            <artifactId>byteman</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.byteman</groupId>
            <artifactId>byteman-bmunit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.kohsuke.metainf-services</groupId>
            <artifactId>metainf-services</artifactId>
            <optional>true</optional>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>${project.basedir}/src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <directory>${project.basedir}/src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-agent</id>
                        <phase>process-test-classes</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.jboss.byteman</groupId>
                                    <artifactId>byteman</artifactId>
                                    <outputDirectory>${project.build.directory}/agents</outputDirectory>
                                    <destFileName>byteman.jar</destFileName>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration combine.self="override">
                    <argLine>-javaagent:${project.build.directory}/agents/byteman.jar=port:9091,boot:${project.build.directory}/agents/byteman.jar ${forkJvmArgs} ${testjvm.jigsawArgs}</argLine>
                    <groups combine.self="override">${defaultJUnitGroups}</groups>
                    <excludedGroups combine.self="override">${defaultExcludedJUnitGroups}</excludedGroups>
                    <systemPropertyVariables>
                        <log4j.configurationFile>${log4j.configurationFile}</log4j.configurationFile>
                        <build.directory>${project.build.directory}</build.directory>
                        <org.jboss.byteman.contrib.bmunit.agent.inhibit>true</org.jboss.byteman.contrib.bmunit.agent.inhibit>
                    </systemPropertyVariables>
                    <trimStackTrace>false</trimStackTrace>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit47</artifactId>
                        <version>${version.maven.surefire}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

</project>
