<?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-all-parent</artifactId>
      <version>9.1.0.Alpha1</version>
      <relativePath>../pom.xml</relativePath>
   </parent>

   <artifactId>infinispan-remote</artifactId>
   <packaging>jar</packaging>
   <name>Infinispan Remote Client</name>
   <description>Infinispan Remote Client All-in-One module</description>

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

   <dependencies>
      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-commons</artifactId>
         <optional>${uberjar.deps.optional}</optional>
      </dependency>

      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-client-hotrod</artifactId>
         <optional>${uberjar.deps.optional}</optional>
      </dependency>

      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-query-dsl</artifactId>
         <optional>${uberjar.deps.optional}</optional>
      </dependency>

      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-remote-query-client</artifactId>
         <optional>${uberjar.deps.optional}</optional>
      </dependency>

      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-cdi-remote</artifactId>
         <optional>${uberjar.deps.optional}</optional>
      </dependency>

      <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-jcache-remote</artifactId>
         <optional>${uberjar.deps.optional}</optional>
      </dependency>

      <dependency>
         <groupId>org.jboss.marshalling</groupId>
         <artifactId>jboss-marshalling-osgi</artifactId>
         <optional>${uberjar.deps.optional}</optional>
      </dependency>

      
      <dependency>
         <groupId>org.wildfly.core</groupId>
         <artifactId>wildfly-controller-client</artifactId>
         <optional>${uberjar.deps.optional}</optional>
      </dependency>

      <dependency>
         <groupId>org.wildfly.core</groupId>
         <artifactId>wildfly-controller</artifactId>
         <optional>${uberjar.deps.optional}</optional>
      </dependency>
   </dependencies>

   <build>
      <finalName>${project.artifactId}-${project.version}</finalName>
      <resources>
         <resource>
            <directory>${project.basedir}/src/main/resources</directory>
            <filtering>true</filtering>
         </resource>
      </resources>
      <plugins>
         <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
               <skipTests>true</skipTests>
            </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>
                     <artifactSet>
                        <excludes>
                           <exclude>org.apache.logging.log4j:log4j-core:jar:</exclude>
                           <exclude>org.apache.logging.log4j:log4j-api:jar:</exclude>
                           <exclude>net.jcip:jcip-annotations:jar:*</exclude>
                           <exclude>org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:*</exclude>
                           <exclude>org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.1_spec:*</exclude>
                           <exclude>javax.cache:cache-api:*</exclude>
                           <exclude>javax.enterprise:cdi-api:*</exclude>
                           <exclude>org.jboss.spec.javax.annotation:jboss-annotations-api_1.1_spec:*</exclude>
                           <exclude>javax.inject:javax.inject:*</exclude>
                           <exclude>org.jgroups:jgroups:*</exclude>
                           <exclude>org.osgi:org.osgi.core:*</exclude>
                           <exclude>org.osgi:org.osgi.compendium:*</exclude>
                        </excludes>
                     </artifactSet>
                     <filters>
                        <filter>
                           <artifact>org.infinispan:infinispan-commons</artifact>
                           <excludes>
                              <exclude>org/infinispan/commons/util/OsgiClassLoader*.class</exclude>
                           </excludes>
                        </filter>
                        <filter>
                           <artifact>org.infinispan.protostream:protostream</artifact>
                           <excludes>
                              <exclude>protostream/javassist/util/HotSwapper*.class</exclude>
                           </excludes>
                        </filter>
                        <filter>
                           <artifact>org.jboss.marshalling:jboss-marshalling</artifact>
                           <excludes>
                              <exclude>org/jboss/marshalling/ModularClassTable*.class</exclude>
                           </excludes>
                        </filter>
                        <filter>
                           <artifact>org.jboss.logging:jboss-logging</artifact>
                           <excludes>
                              <exclude>org/jboss/logging/JBossLogManagerLogger*.class</exclude>
                              <exclude>org/jboss/logging/JBossLogManagerProvider*.class</exclude>
                              <exclude>org/jboss/logging/Slf4jLogger*.class</exclude>
                              <exclude>org/jboss/logging/Log4jLogger*.class</exclude>
                              <exclude>org/jboss/logging/Slf4jLocationAwareLogger*.class</exclude>
                           </excludes>
                        </filter>
                        <filter>
                           <artifact>*:*</artifact>
                           <excludes>
                              <exclude>INSTALL.html</exclude>
                              <exclude>LICENSE</exclude>
                              <exclude>XPP3-LICENSE.txt</exclude>
                              <exclude>README</exclude>
                              <exclude>META-INF/*.SF</exclude>
                              <exclude>META-INF/*.DSA</exclude>
                              <exclude>META-INF/*.RSA</exclude>
                              <exclude>META-INF/ASL2.0</exclude>
                              <exclude>META-INF/DEPENDENCIES</exclude>
                              <exclude>META-INF/DEPENDENCIES.txt</exclude>
                              <exclude>META-INF/LICENSE</exclude>
                              <exclude>META-INF/LICENSE.txt</exclude>
                              <exclude>META-INF/NOTICE</exclude>
                              <exclude>META-INF/NOTICE.txt</exclude>
                              <exclude>jboss-as-checkstyle/checkstyle.xml</exclude>
                              <exclude>schema/*.xsd</exclude>
                              <exclude>__redirected*</exclude>
                           </excludes>
                        </filter>
                     </filters>
                     <createSourcesJar>${createSourcesJar}</createSourcesJar>
                     <relocations>
                        <relocation>
                           <pattern>org.apache.commons</pattern>
                           <shadedPattern>infinispan.org.apache.commons</shadedPattern>
                        </relocation>
                        <relocation>
                           <pattern>org.slf4j</pattern>
                           <shadedPattern>infinispan.org.slf4j</shadedPattern>
                        </relocation>
                        <relocation>
                           <pattern>com.google</pattern>
                           <shadedPattern>infinispan.com.google</shadedPattern>
                        </relocation>
                        
                        
                        
                        
                        
                           
                           
                        
                        <relocation>
                           <pattern>org.jboss.threads</pattern>
                           <shadedPattern>infinispan.org.jboss.threads</shadedPattern>
                        </relocation>
                        <relocation>
                           <pattern>org.jboss.remoting3</pattern>
                           <shadedPattern>infinispan.org.jboss.remoting3</shadedPattern>
                        </relocation>
                        <relocation>
                           <pattern>org.jboss.logging</pattern>
                           <shadedPattern>infinispan.org.jboss.logging</shadedPattern>
                        </relocation>
                        <relocation>
                           <pattern>org.jboss.dmr</pattern>
                           <shadedPattern>infinispan.org.jboss.dmr</shadedPattern>
                        </relocation>
                        <relocation>
                           <pattern>org.jboss.as</pattern>
                           <shadedPattern>infinispan.org.jboss.as</shadedPattern>
                        </relocation>
                        <relocation>
                           <pattern>com.squareup</pattern>
                           <shadedPattern>infinispan.com.squareup</shadedPattern>
                        </relocation>
                        
                        
                        
                           
                           
                        
                     </relocations>
                     <transformers>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.DontIncludeResourceTransformer">
                           <resources>
                              <resource>blueprint.xml</resource>
                           </resources>
                        </transformer>
                        <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                        <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
                           <resource>META-INF/beans.xml</resource>
                        </transformer>
                     </transformers>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <executions>
               <execution>
                  <id>default-bundle</id>
                  <phase>none</phase>
               </execution>
               <execution>
                  <id>bundle-package</id>
                  <phase>package</phase>
                  <goals>
                     <goal>bundle</goal>
                  </goals>
                  <configuration>
                     <instructions>
                        <Include-Resource>
                           @${intermediary_jar_path},
                           /features.xml=${project.basedir}/target/classes/features.xml
                        </Include-Resource>
                        <_exportcontents>
                           org.infinispan.client.hotrod.*,
                           org.infinispan.commons.*,
                           org.infinispan.query.*,
                           org.infinispan.protostream.*;version=${version.protostream}
                        </_exportcontents>
                        <Export-Package>
                           !${project.groupId}.*.logging
                        </Export-Package>
                        <Import-Package>
                           !infinispan.*,
                           !org.infinispan.*,
                           !javax.*,
                           !sun.misc,
                           !sun.reflect,
                           !com.sun.jmx.*,
                           !com.sun.jdi.*,
                           !net.jcip.annotations,
                           !org.jboss.logmanager.*,
                           !org.jboss.logging.annotations.*,
                           !org.jboss.modules,
                           !org.w3c.*,
                           !org.wildfly.*,
                           !org.xml.*,
                           !org.apache.logging.log4j.*,
                           *
                        </Import-Package>
                        <DynamicImport-Package>*</DynamicImport-Package>
                     </instructions>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
               <execution>
                  <id>attach-feature-xml</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>
               <execution>
                  <id>attach-source-jar</id>
                  <phase>package</phase>
                  <goals>
                     <goal>attach-artifact</goal>
                  </goals>
                  <configuration>
                     <skipAttach>${skipCreateSourcesJar}</skipAttach>
                     <artifacts>
                        <artifact>
                           
                           <file>target/${project.build.finalName}-shaded-sources.jar</file>
                           <type>jar</type>
                           <classifier>sources</classifier>
                        </artifact>
                     </artifacts>
                  </configuration>
               </execution>
            </executions>
         </plugin>
      </plugins>
   </build>

</project>