<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">
  <parent>
    <groupId>org.exoplatform.jcr</groupId>
    <artifactId>jcr-parent</artifactId>
    <version>1.10.6</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <artifactId>exo.jcr.component.core</artifactId>
  <name>eXo JCR Service core</name>
  <description>eXo JCR Service core component</description>

  <properties>
      <exo.tck.skip>true</exo.tck.skip>
  </properties>
  
  <dependencies>

    <!-- JCR API -->

    <dependency>
      <groupId>javax.jcr</groupId>
      <artifactId>jcr</artifactId>
      <version>1.0</version>
      <scope>compile</scope>
    </dependency>

    <!-- eXo dependencies (eXo JCR API) -->

    <dependency>
      <groupId>org.exoplatform.kernel</groupId>
      <artifactId>exo.kernel.container</artifactId>
      <version>${org.exoplatform.kernel.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.exoplatform.kernel</groupId>
      <artifactId>exo.kernel.component.command</artifactId>
      <version>${org.exoplatform.kernel.version}</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>org.exoplatform.kernel</groupId>
      <artifactId>exo.kernel.component.common</artifactId>
      <version>${org.exoplatform.kernel.version}</version>
      <scope>provided</scope>
    </dependency>

    <!-- eXo dependencies (eXo JCR Impl) -->

    <dependency>
      <groupId>org.exoplatform.kernel</groupId>
      <artifactId>exo.kernel.component.cache</artifactId>
      <version>${org.exoplatform.kernel.version}</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>org.exoplatform.core</groupId>
      <artifactId>exo.core.component.organization.api</artifactId>
      <version>${org.exoplatform.core.version}</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>org.exoplatform.core</groupId>
      <artifactId>exo.core.component.document</artifactId>
      <version>${org.exoplatform.core.version}</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>org.exoplatform.core</groupId>
      <artifactId>exo.core.component.security.core</artifactId>
      <version>${org.exoplatform.core.version}</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>org.exoplatform.core</groupId>
      <artifactId>exo.core.component.database</artifactId>
      <version>${org.exoplatform.core.version}</version>
      <scope>compile</scope>
    </dependency>

    <!-- DEPRECATED: Third party dependencies (eXo JCR API) -->

    <!--
      dependency> <groupId>jibx</groupId> <artifactId>jibx-bind</artifactId> <version>1.1.3</version> </dependency> <dependency> <groupId>jibx</groupId>
      <artifactId>jibx-run</artifactId> <version>1.1.3</version> </dependency> <dependency> <groupId>bcel</groupId> <artifactId>bcel</artifactId>
      <version>5.1</version> <scope>compile</scope> </dependency> <dependency> <groupId>xpp3</groupId> <artifactId>xpp3</artifactId>
      <version>1.1.3.4.O</version> <scope>compile</scope> </dependency -->

    <!-- Third party dependencies (eXo JCR Impl) -->

    <dependency>
      <groupId>org.apache.lucene</groupId>
      <artifactId>lucene-core</artifactId>
      <version>2.2.0</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.lucene</groupId>
      <artifactId>lucene-spellchecker</artifactId>
      <version>2.2.0</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.lucene</groupId>
      <artifactId>lucene-memory</artifactId>
      <version>2.2.0</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>javax.xml.stream</groupId>
      <artifactId>stax-api</artifactId>
      <version>1.0</version>
    </dependency>

    <dependency>
      <groupId>com.sun.xml.stream</groupId>
      <artifactId>sjsxp</artifactId>
      <version>1.0</version>
    </dependency>

    <dependency>
      <groupId>hsqldb</groupId>
      <artifactId>hsqldb</artifactId>
      <!-- version>1.7.3.3</version -->
      <version>1.8.0.7</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>commons-dbcp</groupId>
      <artifactId>commons-dbcp</artifactId>
      <version>1.2.1</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>jotm</groupId>
      <artifactId>jotm</artifactId>
      <version>2.0.10</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <groupId>javax.resource</groupId>
          <artifactId>connector</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>javax.resource</groupId>
      <artifactId>connector-api</artifactId>
      <version>1.5</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>javax.transaction</groupId>
      <artifactId>jta</artifactId>
      <version>1.0.1B</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>concurrent</groupId>
      <artifactId>concurrent</artifactId>
      <version>1.3.4</version>
      <scope>compile</scope>
    </dependency>

    <!-- slf4j-log4j12 for TCK -->
    <!-- url>http://www.slf4j.org/download.html</url -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>1.0</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>commons-collections</groupId>
      <artifactId>commons-collections</artifactId>
      <version>3.1</version>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <version>1.2</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.ws.commons</groupId>
      <artifactId>ws-commons-util</artifactId>
      <version>1.0.1</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <groupId>xml-apis</groupId>
          <artifactId>xml-apis</artifactId>
        </exclusion>
      </exclusions>

    </dependency>

    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>jackrabbit-jcr-tests</artifactId>
      <version>1.4</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>net.sf.ehcache</groupId>
      <artifactId>ehcache</artifactId>
      <version>1.4.1</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.jcs</groupId>
      <artifactId>jcs</artifactId>
      <version>1.3</version>
      <scope>test</scope>
    </dependency>

    <!-- ===== Databases JDBC support ===== -->

    <!-- For MySQL support -->
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>5.0.8</version>
      <scope>compile</scope>
    </dependency>

    <!-- For PostgresSQL support -->
    <!--
      dependency> <groupId>postgresql</groupId> <artifactId>postgresql</artifactId> <version>8.2-504.jdbc3</version> <scope>compile</scope> </dependency -->

    <!-- For Oracle 10g support (local-jcr repository) -->
    <!--
      dependency> <groupId>ojdbc</groupId> <artifactId>ojdbc</artifactId> <version>14</version> <scope>compile</scope> </dependency> <dependency>
      <groupId>ojdbc</groupId> <artifactId>orai18n</artifactId> <version>14</version> <scope>compile</scope> </dependency -->

    <!-- For IBM DB2 support (local-jcr repository) -->
    <!--
      dependency> <groupId>com.ibm.db2</groupId> <artifactId>db2jcc</artifactId> <version>9.1</version> <scope>compile</scope> </dependency> <dependency>
      <groupId>com.ibm.db2</groupId> <artifactId>db2jcc_license_cu</artifactId> <version>9.1</version> <scope>compile</scope> </dependency -->

    <!-- For MS SQL 7/2000/2005 and Sybase ASE/Anywhere support (jTDS driver) -->
    <!--
      dependency> <groupId>net.sourceforge.jtds</groupId> <artifactId>jtds</artifactId> <version>1.2</version> <scope>compile</scope> </dependency -->

    <!-- For MS SQL 2005 support (Microsoft JDBC driver) (local-jcr repository) -->
    <!--
      dependency> <groupId>com.microsoft.sqlserver</groupId> <artifactId>sqljdbc</artifactId> <version>9.0</version> <scope>compile</scope> </dependency -->

    <!-- For Sybase ASE/Anywhere support (jConnect driver) (local-jcr repository) -->
    <!--
      dependency> <groupId>com.sybase.jdbc3.jdbc</groupId> <artifactId>jconn3</artifactId> <version>6.05</version> <scope>compile</scope> </dependency -->

    <!-- For Apache Derby support (aka JavaDB) -->
    <!--
      dependency> <groupId>org.apache.derby</groupId> <artifactId>derby</artifactId> <version>10.2.2.0</version> <scope>compile</scope> </dependency -->

    <!-- H2 Database -->
    <!--
      dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <version>1.0.74</version> <scope>compile</scope> </dependency -->
    <!-- ======================================================================= -->

  </dependencies>

  <build>
    <sourceDirectory>src/main/java</sourceDirectory>
    <outputDirectory>target/classes</outputDirectory>

    <resources>
      <resource>
        <directory>src/main/java</directory>
        <includes>
          <include>**/*.xml</include>
          <include>**/*.properties</include>
          <include>**/*.xsl</include>
          <include>**/*.dtd</include>
        </includes>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
        <includes>
          <include>**/*.xml</include>
          <include>**/*.properties</include>
          <include>**/login.conf</include>
          <include>**/*.sql</include>
          <include>**/META-INF/**/*.*</include>
          <include>**/*.dtd</include>
        </includes>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/java</directory>
        <includes>
          <include>**/*.properties</include>
          <include>**/*.xml</include>
          <include>**/*.drl</include>
          <include>**/*.vm</include>
          <include>**/*.doc</include>
          <include>**/*.xls</include>
          <include>**/*.ppt</include>
          <include>**/*.txt</include>
          <include>**/*.dtd</include>
        </includes>
      </testResource>
      <testResource>
        <directory>src/test/resources</directory>
        <includes>
          <include>**/*.properties</include>
          <include>**/*.xml</include>
          <include>**/*.drl</include>
          <include>**/*.vm</include>
          <include>**/*.doc</include>
          <include>**/*.xls</include>
          <include>**/*.ppt</include>
          <include>**/*.txt</include>
          <include>**/*.tiff</include>
          <include>**/*.pdf</include>
          <include>**/*.dtd</include>
        </includes>
      </testResource>
      <testResource>
        <directory>src/TCK/java</directory>
        <includes>
          <include>**/org/apache/jackrabbit/test/api/nodetype/spec/*.txt</include>
        </includes>
      </testResource>
    </testResources>

    <testSourceDirectory>src/test/java</testSourceDirectory>
    <testOutputDirectory>target/test-classes</testOutputDirectory>

    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <!-- normal mode: mvn -Dexo.test.skip=false -Dexo.tck.skip=false clean install -->
        <!-- debug  mode: mvn -Dexo.test.skip=false -Dexo.tck.skip=false -Dexo.test.forkmode=never clean install
        -->
        <!-- forking: to run both eXo test and TCK use forkMode=once, to run one of them (only) in Eclipse debug use forkMode=never
        -->
        <configuration>
          <skip>true</skip>
        </configuration>
        <executions>
          <execution>
            <id>execution0 - developers tests</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <systemProperties>
                <property>
                  <name>jcr.test.configuration.file</name>
                  <value>${jcr.test.configuration.file}</value>
                </property>
              </systemProperties>
              <includes>
                <include>**/**/TestErrorMultithreading__.java</include>
                <include>**/**/TestConcurrentItems__.java</include>

                <include>**/**/TestJDBCValueContentAddressStorageImpl__.java</include>
                <include>**/**/TestCASableSimpleFileIOChannel__.java</include>
                <include>**/**/TestCASableTreeFileIOChannel__.java</include>
                <include>**/**/TestInvalidItemState__.java</include>

                <include>**/**/TestCleanableFileStreamValueData.java</include>
              </includes>
            </configuration>
          </execution>
          <execution>
            <id>execution1 - exo tests</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
   <!-- Use default maven values
              <skip>${exo.test.skip}</skip>
              <classesDirectory>${exo.test.classesdirectory}</classesDirectory>
              <forkMode>${exo.test.forkMode}</forkMode>
   -->
              <argLine>-Xmx512M</argLine>
              <systemProperties>
                <property>
                  <name>jcr.test.configuration.file</name>
                  <value>${jcr.test.configuration.file}</value>
                </property>
              </systemProperties>
              <includes>
                <include>**/api/**/Test*.java</include>
                <include>**/usecases/**/Test*.java</include>
                <include>**/usecases/**/*Test.java</include>
                <include>**/impl/**/Test*.java</include>
              </includes>
              <excludes>
                <exclude>**/TestErrorMultithreading.java</exclude>
                <exclude>**/api/**/TestSameNameItems.java</exclude>
                <exclude>**/api/**/TestVersionRestore.java</exclude>
                <exclude>**/impl/**/TestWorkspaceManagement.java</exclude>
                <exclude>**/impl/**/TestRepositoryManagement.java</exclude>
                <exclude>**/impl/**/TestSaveConfiguration.java</exclude>
                <exclude>**/impl/**/ValueStoragePluginTest.java</exclude>
                <exclude>**/impl/**/TestWorkspaceRestore.java</exclude>
                <exclude>**/impl/**/TestSessionCleaner.java</exclude>
                <exclude>**/impl/**/Base*.java</exclude>
                <exclude>**/api/TestAll.java</exclude>
                <!--exclude>**/usecases/**/TestDateBetween.java</exclude-->
                <exclude>**/usecases/**/RemoveSameNameSiblingTest.java</exclude>
                <exclude>**/usecases/**/TestQueryWithNumberAndSpace.java</exclude>
                <exclude>**/usecases/BaseUsecasesTest.java</exclude>
                <exclude>**/apache/**</exclude>
                <exclude>**/api/**/TestSameNameItems.java</exclude>
                <exclude>**/api/**/TestVersionRestore.java</exclude>
              </excludes>
            </configuration>
          </execution>
          <execution>
            <id>execution2 - pause 10 sec</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <skip>${exo.tck.skip}</skip>
              <includes>
                <include>**/util/Sleeping10Seconds.java</include>
              </includes>
            </configuration>
          </execution>
          <execution>
            <id>execution3 - TCK init section</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <argLine>-Xmx512M</argLine>
              <systemProperties>
                <property>
                  <name>jcr.test.configuration.file</name>
                  <value>${jcr.test.configuration.file}</value>
                </property>
              </systemProperties>
              <includes>
                <include>org/exoplatform/services/jcr/integration/PrepareTestRepository.java</include>
              </includes>
            </configuration>
          </execution>
          <execution>
            <id>execution4 - pause 10 sec</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <skip>${exo.tck.skip}</skip>
              <includes>
                <include>**/util/Sleeping10Seconds.java</include>
              </includes>
            </configuration>
          </execution>
          <execution>
            <id>execution5 - integration tests (TCK)</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <skip>${exo.tck.skip}</skip>
              <argLine>-Xmx512M</argLine>
              <systemProperties>
                <property>
                  <name>jcr.test.configuration.file</name>
                  <value>${jcr.test.configuration.file}</value>
                </property>
                <property>
                  <name>emma.coverage.out.file</name>
                  <value>target/emma/coverage.ec</value>
                </property>
                <property>
                  <name>known.issues</name>
                  <value>
                    org.apache.jackrabbit.test.api.nodetype.PropertyDefTest#testIsRequiredType
                    org.apache.jackrabbit.test.api.DocumentViewImportTest#testSessionImportXml
                    org.apache.jackrabbit.test.api.DocumentViewImportTest#testWorkspaceImportXml
                    org.apache.jackrabbit.test.api.DocumentViewImportTest#testWorkspaceGetImportContentHandler
                    org.apache.jackrabbit.test.api.DocumentViewImportTest#testSessionGetImportContentHandler
                    org.apache.jackrabbit.test.api.SetPropertyConstraintViolationExceptionTest#testBooleanProperty
                    org.apache.jackrabbit.test.api.SetValueConstraintViolationExceptionTest#testMultipleBooleanProperty
                    org.apache.jackrabbit.test.api.SetValueConstraintViolationExceptionTest#testBooleanProperty
                    org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreName
                    org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreOrder
                    org.apache.jackrabbit.test.api.version.RestoreTest#testRestoreOrder2
                  </value>
                </property>
              </systemProperties>
              <includes>
                <include>**/api/*Test.java</include>
                <include>**/api/observation/*Test.java</include>
                <include>**/api/lock/*Test.java</include>
                <include>**/api/nodetype/*Test.java</include>
                <include>**/api/query/*Test.java</include>
                <include>**/api/version/*Test.java</include>
              </includes>
              <excludes>
                <exclude>**/api/TestAll.java</exclude>
                <exclude>**/api/**/Abstract*.java</exclude>
                <exclude>**/api/**/FrozenNodeTest.java</exclude>
                <exclude>**/exoplatform/**</exclude>
              </excludes>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.jibx</groupId>
        <artifactId>maven-jibx-plugin</artifactId>
        <version>1.1.6a</version>
        <configuration>
          <directory>src/main/resources</directory>
          <includes>
            <includes>binding*.xml</includes>
          </includes>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>bind</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>delete-sources</id>
            <phase>process-sources</phase>
            <configuration>
              <tasks>
                <echo>Remove files that have been customized</echo>
                <delete>
                  <fileset dir="${project.build.directory}/generated-sources/javacc/org/exoplatform/services/jcr/impl/core/query">
                    <include name="sql/ASTLiteral.java" />
                    <include name="sql/ASTContainsExpression.java" />
                    <include name="sql/ASTPredicate.java" />
                    <include name="sql/ASTIdentifier.java" />
                    <include name="xpath/SimpleNode.java" />
                  </fileset>
                </delete>
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>ant</groupId>
            <artifactId>ant-optional</artifactId>
            <version>1.5.3-1</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>javacc-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>fulltext</id>
            <configuration>
              <sourceDirectory>${basedir}/src/main/javacc/fulltext</sourceDirectory>
            </configuration>
            <goals>
              <goal>jjtree-javacc</goal>
            </goals>
          </execution>
          <execution>
            <id>sql</id>
            <configuration>
              <sourceDirectory>${basedir}/src/main/javacc/sql</sourceDirectory>
            </configuration>
            <goals>
              <goal>jjtree-javacc</goal>
            </goals>
          </execution>
          <execution>
            <id>xpath</id>
            <configuration>
              <sourceDirectory>${basedir}/src/main/javacc/xpath</sourceDirectory>
            </configuration>
            <goals>
              <goal>jjtree-javacc</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>net.java.dev.javacc</groupId>
            <artifactId>javacc</artifactId>
            <version>3.2</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>taglist-maven-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>default</id>
      <activation>
        <property>
          <name>default</name>
        </property>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <jcr.test.configuration.file>/conf/standalone/test-configuration.xml</jcr.test.configuration.file>
        <exo.devtest.skip>true</exo.devtest.skip>
      </properties>
    </profile>
  </profiles>
</project>
