<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.overlord.sramp</groupId>
    <artifactId>s-ramp-distro</artifactId>
    <version>0.4.0.Final</version>
  </parent>
  <artifactId>s-ramp-distro-fuse61</artifactId>
  <packaging>pom</packaging>
  <name>S-RAMP Distribution: Fuse 6.1 Support</name>

  <!-- Overrides for Karaf -->
  <dependencyManagement>
    <dependencies>
      <!-- Downgrade to slf4j-ext 1.7.1 so it will run in Fuse 6.1 -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-ext</artifactId>
        <version>1.7.1</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <!-- Include the base s-ramp-server WAR to pull in all required dependencies transitively -->
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-server</artifactId>
      <version>${project.version}</version>
      <type>jar</type>
      <classifier>classes</classifier>
      <exclusions>
        <!-- Exclude JBoss Marshalling JAR so we can later include the -->
        <exclusion>
          <artifactId>jboss-marshalling-river</artifactId>
          <groupId>org.jboss.marshalling</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jboss-marshalling</artifactId>
          <groupId>org.jboss.marshalling</groupId>
        </exclusion>
        <exclusion>
          <artifactId>snappy-java</artifactId>
          <groupId>org.xerial.snappy</groupId>
        </exclusion>
        <exclusion>
          <artifactId>lucene-core</artifactId>
          <groupId>org.apache.lucene</groupId>
        </exclusion>
        <exclusion>
          <artifactId>lucene-facet</artifactId>
          <groupId>org.apache.lucene</groupId>
        </exclusion>
        <exclusion>
          <artifactId>slf4j-api</artifactId>
          <groupId>org.slf4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jaxb-impl</artifactId>
          <groupId>com.sun.xml.bind</groupId>
        </exclusion>
        <exclusion>
          <artifactId>xmlbeans</artifactId>
          <groupId>org.apache.xmlbeans</groupId>
        </exclusion>
        <exclusion>
          <artifactId>log4j</artifactId>
          <groupId>log4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>slf4j-log4j12</artifactId>
          <groupId>org.slf4j</groupId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- Include the fuse version of the server WAR -->
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-server-fuse61</artifactId>
      <version>${project.version}</version>
      <type>war</type>
    </dependency>

    <!-- Include the Fuse 6.1 version of the UI WAR -->
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-ui-war-fuse61</artifactId>
      <version>${project.version}</version>
      <type>war</type>
    </dependency>
    <!-- Additional 3rd party libraries -->
    <dependency>
      <groupId>org.overlord</groupId>
      <artifactId>overlord-commons-auth</artifactId>
    </dependency>
    <dependency>
      <groupId>org.overlord</groupId>
      <artifactId>overlord-commons-auth-jetty8</artifactId>
    </dependency>
    <dependency>
      <groupId>org.picketlink</groupId>
      <artifactId>picketlink-core</artifactId>
      <version>${picketlink.version}</version>
      <exclusions>
        <exclusion>
          <artifactId>log4j</artifactId>
          <groupId>log4j</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.servicemix.bundles</groupId>
      <artifactId>org.apache.servicemix.bundles.lucene</artifactId>
      <version>${version.org.apache.lucene}_1</version>
    </dependency>
    <dependency>
      <groupId>org.jboss.marshalling</groupId>
      <artifactId>jboss-marshalling-osgi</artifactId>
      <version>${version.org.jboss.marshalling.jboss-marshalling}</version>
    </dependency>
    <dependency>
      <groupId>commons-beanutils</groupId>
      <artifactId>commons-beanutils-core</artifactId>
      <version>1.8.0</version>
    </dependency>
    <dependency>
      <groupId>commons-digester</groupId>
      <artifactId>commons-digester</artifactId>
      <version>1.8</version>
    </dependency>
    <dependency>
      <groupId>commons-jxpath</groupId>
      <artifactId>commons-jxpath</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.servlet.jsp</groupId>
      <artifactId>jsp-api</artifactId>
      <version>2.2</version>
    </dependency>
    <dependency>
      <groupId>ant</groupId>
      <artifactId>ant</artifactId>
      <version>1.6.5</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-ext</artifactId>
      <exclusions>
        <exclusion>
          <artifactId>slf4j-api</artifactId>
          <groupId>org.slf4j</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.datastax.cassandra</groupId>
      <artifactId>cassandra-driver-core</artifactId>
      <version>1.0.4</version>
      <exclusions>
        <exclusion>
          <artifactId>snappy-java</artifactId>
          <groupId>org.xerial.snappy</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jetty</artifactId>
          <groupId>org.mortbay.jetty</groupId>
        </exclusion>
        <exclusion>
          <artifactId>servlet-api</artifactId>
          <groupId>javax.servlet</groupId>
        </exclusion>
        <exclusion>
          <artifactId>slf4j-api</artifactId>
          <groupId>org.slf4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jline</artifactId>
          <groupId>jline</groupId>
        </exclusion>
        <exclusion>
          <artifactId>log4j</artifactId>
          <groupId>log4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>slf4j-log4j12</artifactId>
          <groupId>org.slf4j</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.mongodb</groupId>
      <artifactId>mongo-java-driver</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.jms</groupId>
      <artifactId>jms</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.security.jacc</groupId>
      <artifactId>javax.security.jacc-api</artifactId>
      <exclusions>
        <exclusion>
          <artifactId>javax.servlet-api</artifactId>
          <groupId>javax.servlet</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.overlord</groupId>
      <artifactId>overlord-commons-osgi</artifactId>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.overlord</groupId>
        <artifactId>overlord-commons-maven-plugin</artifactId>
        <version>${overlord-commons.version}</version>
        <executions>
          <execution>
            <phase>generate-resources</phase>
            <goals>
              <goal>generate-features-xml</goal>
            </goals>
            <configuration>
              <outputFile>${project.build.directory}/features.xml</outputFile>
              <attach>true</attach>
              <features>
                <!-- All S-RAMP Dependencies -->
                <feature>
                  <name>s-ramp-dependencies</name>
                  <version>${project.version}</version>
                  <comment>All S-RAMP dependencies</comment>
                  <dependsOnFeatures>
                    <feature>
                      <name>http</name>
                    </feature>
                  </dependsOnFeatures>
                  <excludes>
                    <exclude>org.overlord.sramp:s-ramp-*:*</exclude>
                    <exclude>org.infinispan:infinispan-core:*</exclude>
                  </excludes>
                  <bundles>
                    <!-- Add the infinispan dependency here in order to override its Import-Package spec (which 
                      includes the problematic sun.misc). -->
                    <bundle>wrap:mvn:org.infinispan/infinispan-core/${version.org.infinispan}$Import-Package=javax.management,javax.naming,javax.transaction,javax.transaction.xa,javax.xml.bind,javax.xml.bind.annotation,javax.xml.bind.annotation.adapters,javax.xml.namespace,javax.xml.parsers,javax.xml.stream,javax.xml.transform,javax.xml.transform.dom,javax.xml.transform.sax,javax.xml.transform.stream,javax.xml.validation,net.jcip.annotations;resolution:=optional,org.jboss.logging;version="[3.1,4)",org.jboss.marshalling,org.jboss.marshalling.reflect,org.jboss.marshalling.river,org.jboss.marshalling.util,org.jboss.staxmapper,org.jgroups;version="[3.2,4)",org.jgroups.blocks;version="[3.2,4)",org.jgroups.blocks.mux;version="[3.2,4)",org.jgroups.jmx;version="[3.2,4)",org.jgroups.logging;version="[3.2,4)",org.jgroups.protocols;version="[3.2,4)",org.jgroups.protocols.relay;version="[3.2,4)",org.jgroups.stack;version="[3.2,4)",org.jgroups.util;version="[3.2,4)",org.osgi.framework;version="[1.6,2)";resolution:=optional,org.w3c.dom,org.xml.sax,org.xml.sax.helpers&amp;overwrite=merge</bundle>
                  </bundles>
                </feature>
                <!-- The S-RAMP Modules -->
                <feature>
                  <name>s-ramp-modules</name>
                  <version>${project.version}</version>
                  <comment>All S-RAMP modules</comment>
                  <dependsOnFeatures>
                    <feature>
                      <name>s-ramp-dependencies</name>
                      <version>${project.version}</version>
                    </feature>
                  </dependsOnFeatures>
                  <includes>
                    <include>org.overlord.sramp:s-ramp-*:jar</include>
                  </includes>
                  <excludes>
                    <exclude>org.overlord.sramp:s-ramp-server*:*</exclude>
                    <exclude>org.overlord.sramp:s-ramp-ui-war*:*</exclude>
                  </excludes>
                </feature>
                <!-- The S-RAMP Server (back-end) -->
                <feature>
                  <name>s-ramp-server</name>
                  <version>${project.version}</version>
                  <comment>The S-RAMP Server (backend)</comment>
                  <dependsOnFeatures>
                    <feature>
                      <name>war</name>
                    </feature>
                    <feature>
                      <name>s-ramp-modules</name>
                      <version>${project.version}</version>
                    </feature>
                  </dependsOnFeatures>
                  <includes>
                    <include>org.overlord.sramp:s-ramp-server-fuse61:war</include>
                  </includes>
                </feature>
                <!-- The S-RAMP UI -->
                <feature>
                  <name>s-ramp-ui</name>
                  <version>${project.version}</version>
                  <comment>The S-RAMP UI (web app)</comment>
                  <dependsOnFeatures>
                    <feature>
                      <name>war</name>
                    </feature>
                    <feature>
                      <name>s-ramp-modules</name>
                      <version>${project.version}</version>
                    </feature>
                  </dependsOnFeatures>
                  <includes>
                    <include>org.overlord.sramp:s-ramp-ui-war-fuse61:war</include>
                  </includes>
                </feature>
                <!-- Everything -->
                <feature>
                  <name>s-ramp</name>
                  <version>${project.version}</version>
                  <comment>S-RAMP (Kitchen Sink)</comment>
                  <dependsOnFeatures>
                    <feature>
                      <name>s-ramp-server</name>
                      <version>${project.version}</version>
                    </feature>
                    <feature>
                      <name>s-ramp-ui</name>
                      <version>${project.version}</version>
                    </feature>
                  </dependsOnFeatures>
                  <excludes>
                    <exclude>*:*:*</exclude>
                  </excludes>
                </feature>
              </features>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
