<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.drools</groupId>
    <artifactId>guvnor</artifactId>
    <version>5.6.0.Final</version>
  </parent>

  <artifactId>guvnor-repository</artifactId>
  <packaging>jar</packaging>

  <name>Guvnor repository</name>
  <description>The DAO layer for Guvnor that uses the JCR API.</description>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <configuration>
          <filesets>
            <fileset>
              <directory>.</directory>
              <includes>
                <include>repository.xml</include>
              </includes>
            </fileset>
            <fileset>
              <directory>repository</directory>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
    </plugins>
    <testResources>
      <testResource>
        <directory>${basedir}/src/test/resources</directory>
      </testResource>
      <testResource>
        <directory>${basedir}/src/test/filtered-resources</directory>
        <filtering>true</filtering>
      </testResource>
    </testResources>
  </build>
  <dependencies>
    <!-- Internal dependencies -->
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>guvnor-repository-connector-jcr</artifactId>
    </dependency>
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>guvnor-api</artifactId>
    </dependency>

    <!-- External dependencies -->
    <dependency>
      <groupId>javax.jcr</groupId>
      <artifactId>jcr</artifactId>
    </dependency>
    <!-- Weld (Context and Dependency Injection) -->
    <dependency>
      <groupId>org.jboss.weld</groupId>
      <artifactId>weld-core</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.enterprise</groupId>
      <artifactId>cdi-api</artifactId>
    </dependency>
    <dependency>
      <groupId>com.thoughtworks.xstream</groupId>
      <artifactId>xstream</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency><!-- Shadowed in JDK 1.5 (by JDK itself!), but needed in JDK 1.6 to run tests -->
      <groupId>xalan</groupId>
      <artifactId>xalan</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile><!-- Default profile -->
      <id>jackrabbitProfile</id>
      <activation>
        <property>
          <name>!modeshape</name>
        </property>
      </activation>
      <properties>
        <RepositoryConfigurator>org.drools.repository.jackrabbit.JackrabbitRepositoryConfigurator</RepositoryConfigurator>
      </properties>
      <dependencies>
        <dependency>
          <groupId>org.drools</groupId>
          <artifactId>guvnor-repository-connector-jackrabbit</artifactId>
          <scope>runtime</scope>
          <!-- Not optional so guvnor works out of the box, exclude this dependency if you use modeshape -->
        </dependency>
        <dependency>
        <!--  Including just the modeshape connector, not the dependencies. This way the user can switch
              over to use the modeshape service later -->
         <groupId>org.drools</groupId>
          <artifactId>guvnor-repository-connector-modeshape</artifactId>
          <scope>runtime</scope>
          <exclusions>
            <exclusion>
              <groupId>org.modeshape</groupId>
              <artifactId>modeshape-jcr</artifactId>
            </exclusion>
           <exclusion>
             <groupId>org.jboss.security</groupId>
             <artifactId>jboss-idtrust</artifactId>
           </exclusion>
           <exclusion>
             <groupId>org.jboss.security</groupId>
             <artifactId>jboss-security-spi-bare</artifactId>
           </exclusion>
           <exclusion>
             <groupId>org.jboss.security</groupId>
             <artifactId>jbosssx-bare</artifactId>
           </exclusion>
         </exclusions>
        </dependency>
      </dependencies>
    </profile>

    <profile><!-- Activated with -Dmodeshape. Requires JDK 1.6. Note that we really only support running ModeShape -->
      <!-- deployed as a service, so we never ship the modeshape jars in the guvnor app. This profile is only here to -->
      <!-- run the unittest using ModeShape -->
      <!-- TODO use enforcer plugin to enforce JDK 1.6. Currently, who actives ms profile must make manually check JDK1.6 is in use. -->
      <id>modeshapeProfile</id>
      <activation>
        <property>
          <name>modeshape</name>
        </property>
      </activation>
      <properties>
        <RepositoryConfigurator>org.drools.repository.modeshape.ModeShapeRepositoryConfiguratorWithJAAS</RepositoryConfigurator>
      </properties>
      <dependencies>
        <dependency>
          <groupId>org.drools</groupId>
          <artifactId>guvnor-repository-connector-modeshape</artifactId>
          <scope>runtime</scope>
        </dependency>
      </dependencies>
    </profile>
  </profiles>

</project>
