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

   <artifactId>infinispan-objectfilter</artifactId>
   <packaging>bundle</packaging>
   <name>Infinispan Object Querying and Filtering API</name>
   <description>Infinispan Object Querying and Filtering based on Ickle, a JP-QL subset</description>

   <dependencies>
      <dependency>
         <groupId>org.jboss.logging</groupId>
         <artifactId>jboss-logging</artifactId>
         <scope>provided</scope>
      </dependency>

      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-query-dsl</artifactId>
      </dependency>

      <dependency>
         <groupId>org.infinispan.protostream</groupId>
         <artifactId>protostream</artifactId>
         <optional>true</optional>
      </dependency>

      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-commons-test</artifactId>
         <scope>test</scope>
      </dependency>

      <dependency>
         <groupId>org.antlr</groupId>
         <artifactId>antlr-runtime</artifactId>
      </dependency>

      <dependency>
         <groupId>org.assertj</groupId>
         <artifactId>assertj-core</artifactId>
         <scope>test</scope>
      </dependency>

      <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <scope>test</scope>
      </dependency>
   </dependencies>

   <properties>
      <intermediary_jar_name>intermediary-${project.build.finalName}</intermediary_jar_name>
      <intermediary_jar_path>${project.build.directory}/${intermediary_jar_name}.jar</intermediary_jar_path>
   </properties>

   <build>
      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration combine.self="override">
               <groups combine.self="override">${defaultJUnitGroups}</groups>
               <excludedGroups combine.self="override">${defaultExcludedJUnitGroups}</excludedGroups>
               <systemPropertyVariables>
                  <!-- Copied from parent POM -->
                  <infinispan.test.jgroups.protocol>${infinispan.test.jgroups.protocol}</infinispan.test.jgroups.protocol>
                  <jgroups.bind_addr>127.0.0.1</jgroups.bind_addr>
                  <jgroups.join_timeout>2000</jgroups.join_timeout>
                  <java.net.preferIPv4Stack>true</java.net.preferIPv4Stack>
                  <log4j.configurationFile>${log4j.configurationFile}</log4j.configurationFile>
                  <build.directory>${project.build.directory}</build.directory>
                  <com.arjuna.ats.arjuna.common.propertiesFile>test-jbossts-properties.xml</com.arjuna.ats.arjuna.common.propertiesFile>

                  <!-- this is picked up in the log4j xml which prepends it to each module's log file-->
                  <infinispan.module-suffix>${infinispan.module-suffix}</infinispan.module-suffix>
                  <ansi.strip>${ansi.strip}</ansi.strip>
                  <!-- Log the correct thread name after we call Thread.setName(),
                       see https://issues.apache.org/jira/browse/LOG4J2-2052 -->
                  <AsyncLogger.ThreadNameStrategy>UNCACHED</AsyncLogger.ThreadNameStrategy>
               </systemPropertyVariables>
               <trimStackTrace>false</trimStackTrace>
               <argLine>-Xmx512m</argLine>
            </configuration>
            <dependencies>
               <dependency>
                  <groupId>org.apache.maven.surefire</groupId>
                  <artifactId>surefire-junit47</artifactId>
                  <version>${version.maven.surefire}</version>
               </dependency>
            </dependencies>
         </plugin>

         <plugin>
            <groupId>org.antlr</groupId>
            <artifactId>antlr3-maven-plugin</artifactId>
            <executions>
               <execution>
                  <id>antlr3</id>
                  <phase>generate-sources</phase>
                  <goals>
                     <goal>antlr</goal>
                  </goals>
               </execution>
            </executions>
            <configuration>
               <sourceDirectory>${basedir}/src/main/antlr3</sourceDirectory>
               <outputDirectory>${project.build.directory}/generated-sources/antlr3</outputDirectory>
            </configuration>
         </plugin>

         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <executions>
               <execution>
                  <id>none-default</id>
                  <phase>package</phase>
                  <goals>
                     <goal>shade</goal>
                  </goals>
                  <configuration>
                     <finalName>${intermediary_jar_name}</finalName>
                     <minimizeJar>true</minimizeJar>
                     <artifactSet>
                        <excludes>
                           <exclude>net.jcip:jcip-annotations:jar:</exclude>
                           <exclude>log4j:log4j:jar:</exclude>
                           <exclude>org.jboss.logging:jboss-logging:jar:</exclude>
                        </excludes>
                     </artifactSet>
                     <relocations>
                        <relocation>
                           <pattern>org.antlr.runtime</pattern>
                           <shadedPattern>org.infinipan.objectfilter.impl.antlr.runtime</shadedPattern>
                        </relocation>
                     </relocations>
                  </configuration>
               </execution>
            </executions>
         </plugin>

         <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <configuration>
               <instructions>
                  <Export-Package>
                     ${project.groupId}.objectfilter.*;version=${project.version};-split-package:=error
                  </Export-Package>
               </instructions>
            </configuration>
         </plugin>
      </plugins>
   </build>

   <profiles>
      <profile>
         <id>smoke</id>
         <build>
            <plugins>
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-surefire-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>default-test</id>
                        <phase>none</phase>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </build>
      </profile>
   </profiles>
</project>
