<?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-parent</artifactId>
        <version>11.0.17.Final</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>infinispan-clustered-lock</artifactId>
    <name>Infinispan Clustered Lock</name>
    <description>Infinispan Clustered Lock module</description>
    <packaging>bundle</packaging>

    <properties>
        <infinispan.test.parallel.threads>1</infinispan.test.parallel.threads>
    </properties>

    <build>
        <resources>
            <resource>
                <directory>${project.basedir}/src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>features.xml</include>
                </includes>
            </resource>
           <resource>
              <directory>${project.basedir}/src/main/resources</directory>
              <filtering>false</filtering>
              <includes>
                 <include>**/*</include>
              </includes>
              <excludes>
                 <exclude>features.xml</exclude>
              </excludes>
           </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-antrun-plugin</artifactId>
              <executions>
                 <execution>
                    <id>generate-blueprint</id>
                    <goals>
                       <goal>run</goal>
                    </goals>
                    <phase>prepare-package</phase>
                 </execution>
              </executions>
           </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <instructions>
                        <Export-Package>
                            !${project.groupId}.lock.api.*;version=${project.version};-split-package:=error,
                            !${project.groupId}.lock.exception.*;version=${project.version};-split-package:=error
                            ${project.groupId}.lock.*;version=${project.version};-split-package:=error
                        </Export-Package>
                        <Include-Resource>
                           {maven-resources},
                           /schema=${project.build.outputDirectory}/schema,
                           /META-INF/services=${project.build.outputDirectory}/META-INF/services,
                           /OSGI-INF/blueprint/blueprint.xml=${project.build.outputDirectory}/OSGI-INF/blueprint/blueprint.xml
                        </Include-Resource>
                    </instructions>
                </configuration>
            </plugin>

         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
               <dependenciesToScan>
                  <!-- TestNGSuiteChecksTest -->
                  <dependency>org.infinispan:infinispan-commons-test</dependency>
               </dependenciesToScan>
            </configuration>
         </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-artifacts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>target/classes/features.xml</file>
                                    <type>xml</type>
                                    <classifier>features</classifier>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>karaf-maven-plugin</artifactId>
                <configuration>
                    <features>
                        <feature>infinispan-clustered-lock</feature>
                    </features>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
       <dependency>
          <groupId>org.infinispan</groupId>
          <artifactId>infinispan-component-processor</artifactId>
       </dependency>
        <dependency>
            <groupId>org.infinispan</groupId>
            <artifactId>infinispan-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>framework</artifactId>
            <type>kar</type>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.infinispan</groupId>
            <artifactId>infinispan-commons</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.infinispan</groupId>
            <artifactId>infinispan-core</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.infinispan</groupId>
            <artifactId>infinispan-commons-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.kohsuke.metainf-services</groupId>
            <artifactId>metainf-services</artifactId>
        </dependency>
        <dependency>
            <groupId>io.projectreactor.tools</groupId>
            <artifactId>blockhound</artifactId>
            <optional>true</optional>
        </dependency>
        <!-- Included to avoid issue in blockhound during tests -->
        <dependency>
            <groupId>org.eclipse.microprofile.metrics</groupId>
            <artifactId>microprofile-metrics-api</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
