<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</artifactId>
    <version>0.5.0.Final</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>
  <artifactId>s-ramp-distro-fuse61</artifactId>
  <packaging>bundle</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>
      <!-- Upgrade to a version of xmlsec that will work in OSGi -->
      <dependency>
        <groupId>org.apache.santuario</groupId>
        <artifactId>xmlsec</artifactId>
        <version>2.0.0</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>
      <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>
        <exclusion>
          <artifactId>jdom</artifactId>
          <groupId>jdom</groupId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- Include the fuse version of the server WAR -->
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-server-fuse61</artifactId>
      <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>
      <type>war</type>
    </dependency>
    <!-- Additional 3rd party libraries -->
    <dependency>
      <groupId>org.picketlink</groupId>
      <artifactId>picketlink-federation</artifactId>
      <exclusions>
        <exclusion>
          <groupId>log4j</groupId>
          <artifactId>log4j</artifactId>
        </exclusion>
        <!-- Exclude xmlsec because it doesn't play well in OSGi -->
        <exclusion>
          <groupId>org.apache.santuario</groupId>
          <artifactId>xmlsec</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.servicemix.bundles</groupId>
      <artifactId>org.apache.servicemix.bundles.lucene</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.marshalling</groupId>
      <artifactId>jboss-marshalling-osgi</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-beanutils</groupId>
      <artifactId>commons-beanutils-core</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-digester</groupId>
      <artifactId>commons-digester</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-jxpath</groupId>
      <artifactId>commons-jxpath</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.spec.javax.servlet.jsp</groupId>
      <artifactId>jboss-jsp-api_2.2_spec</artifactId>
    </dependency>    
    <dependency>
      <groupId>org.apache.ant</groupId>
      <artifactId>ant</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jdom</groupId>
      <artifactId>jdom</artifactId>
    </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>
      <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>
          <groupId>javax.servlet</groupId>
          <artifactId>javax.servlet-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.hibernate.javax.persistence</groupId>
      <artifactId>hibernate-jpa-2.0-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.infinispan</groupId>
      <artifactId>infinispan-cachestore-jdbc</artifactId>
    </dependency>
    <dependency>
	    <groupId>commons-dbcp</groupId>
	    <artifactId>commons-dbcp</artifactId>
	</dependency>
	<dependency>
	    <groupId>com.h2database</groupId>
	    <artifactId>h2</artifactId>
	</dependency>
    <dependency>
      <groupId>org.overlord</groupId>
      <artifactId>overlord-commons-osgi-weld</artifactId>
    </dependency>
    <dependency>
        <groupId>io.fabric8</groupId>
        <artifactId>fabric-api</artifactId>
     </dependency> 
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.overlord</groupId>
        <artifactId>overlord-commons-maven-plugin</artifactId>
        <version>${version.org.overlord.overlord-commons}</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>
              <repositories>
                <repository>mvn:org.overlord/overlord-commons-dist-fuse6/${version.org.overlord.overlord-commons}/xml/features</repository>
              </repositories>
              <features>
                <!-- All S-RAMP Dependencies -->
                <feature>
                  <name>s-ramp-dependencies</name>
                  <version>${project.version}</version>
                  <comment>All S-RAMP dependencies</comment>
                  <dependsOnFeatures>
                    <feature>
                      <name>overlord-commons-idp</name>
                    </feature>
                    <feature>
                      <name>http</name>
                    </feature>
                    <feature>
                      <name>jndi</name>
                    </feature>
                  </dependsOnFeatures>

                  <excludes>
                    <exclude>org.overlord.sramp:s-ramp-*:*</exclude>
                    <exclude>org.overlord:overlord-commons-*:*</exclude>
                  </excludes>
                  <bundles>
                    <!-- TODO: overlord-commons-maven-plugin isn't picking this up.  For now, be explicit. -->
                    <bundle>mvn:org.overlord.sramp/s-ramp-distro-fuse61/${project.version}</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>
                    <feature>
                      <name>overlord-commons</name>
                      <version>${version.org.overlord.overlord-commons}</version>
                    </feature>
                  </dependsOnFeatures>
                  <includes>
                    <include>org.overlord.sramp:s-ramp-*:*</include>
                  </includes>
                  <excludes>
                    <exclude>org.overlord.sramp:s-ramp-server*:*</exclude>
                    <exclude>org.overlord.sramp:s-ramp-ui-war*:*</exclude>
                    <exclude>org.overlord.sramp:s-ramp-installer*:*</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>

      <!-- Disable 'require plugin versions' as reports issue when overlord-commons plugin is using snapshot -->
      <plugin>
          <artifactId>maven-enforcer-plugin</artifactId>
          <executions>
              <execution>
                  <id>enforce-plugin-versions</id>
                  <phase>none</phase>
              </execution>
          </executions>
      </plugin>
      
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
            <Bundle-Name>${project.name}</Bundle-Name>
            <Bundle-Version>${project.version}</Bundle-Version>
          </instructions>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
