<?xml version="1.0" encoding="UTF-8"?>

<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
  -->

<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.apache.jackrabbit</groupId>
    <artifactId>oak-parent</artifactId>
    <version>1.1.0</version>
    <relativePath>../oak-parent/pom.xml</relativePath>
  </parent>

  <artifactId>oak-core</artifactId>
  <name>Oak Core</name>
  <packaging>bundle</packaging>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <configuration>
          <instructions>
            <Embed-Dependency>
              <!-- OAK-1768 TODO: embedded as short term workaround -->
              mapdb,
              <!-- OAK-1708 TODO: temporary workaround for embedding code for DocumentNodeStoreService-->
              commons-dbcp,commons-pool,h2,json-simple,
              <!-- OAK-1708 TODO: note these below will only embedded when build with the respective profiles from oak-parent -->
              postgresql,db2,db2-license,mysql-connector-java,ojdbc6
            </Embed-Dependency>
            <Embed-Transitive>true</Embed-Transitive>
            <Import-Package>
              *;resolution:=optional
            </Import-Package>
            <Export-Package>
              org.apache.jackrabbit.oak,
              org.apache.jackrabbit.oak.api,
              org.apache.jackrabbit.oak.api.jmx,
              org.apache.jackrabbit.oak.stats,
              org.apache.jackrabbit.oak.kernel,
              org.apache.jackrabbit.oak.management,
              org.apache.jackrabbit.oak.util,
              org.apache.jackrabbit.oak.namepath,
              org.apache.jackrabbit.oak.osgi,
              org.apache.jackrabbit.oak.plugins.backup,
              org.apache.jackrabbit.oak.plugins.commit,
              org.apache.jackrabbit.oak.plugins.identifier,
              org.apache.jackrabbit.oak.plugins.index,
              org.apache.jackrabbit.oak.plugins.index.aggregate,
              org.apache.jackrabbit.oak.plugins.index.nodetype,
              org.apache.jackrabbit.oak.plugins.index.property,
              org.apache.jackrabbit.oak.plugins.index.property.jmx,
              org.apache.jackrabbit.oak.plugins.index.reference,
              org.apache.jackrabbit.oak.plugins.itemsave,
              org.apache.jackrabbit.oak.plugins.lock,
              org.apache.jackrabbit.oak.plugins.memory,
              org.apache.jackrabbit.oak.plugins.name,
              org.apache.jackrabbit.oak.plugins.nodetype,
              org.apache.jackrabbit.oak.plugins.nodetype.write,
              org.apache.jackrabbit.oak.plugins.observation,
              org.apache.jackrabbit.oak.plugins.observation.filter,
              org.apache.jackrabbit.oak.plugins.segment,
              org.apache.jackrabbit.oak.plugins.segment.http,
              org.apache.jackrabbit.oak.plugins.segment.file,
              org.apache.jackrabbit.oak.plugins.value,
              org.apache.jackrabbit.oak.plugins.version,
              org.apache.jackrabbit.oak.spi.commit,
              org.apache.jackrabbit.oak.spi.lifecycle,
              org.apache.jackrabbit.oak.spi.query,
              org.apache.jackrabbit.oak.spi.security,
              org.apache.jackrabbit.oak.spi.security.authentication,
              org.apache.jackrabbit.oak.spi.security.authentication.callback,
              org.apache.jackrabbit.oak.spi.security.authentication.token,
              org.apache.jackrabbit.oak.spi.security.authorization,
              org.apache.jackrabbit.oak.spi.security.authorization.accesscontrol,
              org.apache.jackrabbit.oak.spi.security.authorization.permission,
              org.apache.jackrabbit.oak.spi.security.authorization.restriction,
              org.apache.jackrabbit.oak.spi.security.principal,
              org.apache.jackrabbit.oak.spi.security.privilege,
              org.apache.jackrabbit.oak.spi.security.user,
              org.apache.jackrabbit.oak.spi.security.user.action,
              org.apache.jackrabbit.oak.spi.security.user.util,
              org.apache.jackrabbit.oak.spi.state,
              org.apache.jackrabbit.oak.spi.whiteboard,
              org.apache.jackrabbit.oak.spi.xml,
              org.apache.jackrabbit.oak.query,
              org.apache.jackrabbit.oak.query.fulltext,
              org.apache.jackrabbit.oak.security
            </Export-Package>
            <Jaas-ModuleClass>
              org.apache.jackrabbit.oak.spi.security.authentication.GuestLoginModule,
              org.apache.jackrabbit.oak.security.authentication.user.LoginModuleImpl,
              org.apache.jackrabbit.oak.security.authentication.token.TokenLoginModule
            </Jaas-ModuleClass>
            <DynamicImport-Package>
              org.apache.felix.jaas.boot
            </DynamicImport-Package>
          </instructions>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-scr-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
            <configuration>
              <excludes>
                <exclude>logback-test.xml</exclude>
              </excludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <configuration>
          <systemPropertyVariables>
            <java.util.logging.config.file>
              src/test/resources/logging.properties
            </java.util.logging.config.file>
          </systemPropertyVariables>
        </configuration>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.rat</groupId>
          <artifactId>apache-rat-plugin</artifactId>
          <configuration>
            <excludes>
              <exclude>
                src/test/resources/org/apache/jackrabbit/oak/util/test.json
              </exclude>
            </excludes>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <dependencies>
    <!-- Optional OSGi dependencies, used only when running within OSGi -->
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.core</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.compendium</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>biz.aQute.bnd</groupId>
      <artifactId>bndlib</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.apache.felix.scr.annotations</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- Dependencies to other Oak components -->
    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>oak-mk-api</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>oak-commons</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>oak-blob</artifactId>
      <version>${project.version}</version>
    </dependency>

    <!-- General utility libraries -->
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <version>1.5</version>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.4</version>
    </dependency>
    <dependency>
      <groupId>com.googlecode.json-simple</groupId>
      <artifactId>json-simple</artifactId>
      <version>1.1.1</version>
      <!--<optional>true</optional>-->
    </dependency>
    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>jackrabbit-aws-ext</artifactId>
      <version>${jackrabbit.version}</version>
      <optional>true</optional>
    </dependency>

    <!-- Optional dependencies for different persistence backends -->
    <dependency>
      <groupId>org.mongodb</groupId>
      <artifactId>mongo-java-driver</artifactId>
      <optional>true</optional>
    </dependency>

    <!--  Optional dependency for jclouds s3 to enable s3 cloud store -->
    <dependency>
      <groupId>org.apache.jclouds.provider</groupId>
      <artifactId>aws-s3</artifactId>
      <optional>true</optional>
    </dependency>

    <!-- Required for OffHeap storage and serialization-->
    <dependency>
      <groupId>com.esotericsoftware.kryo</groupId>
      <artifactId>kryo</artifactId>
      <version>2.22</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.apache.directmemory</groupId>
      <artifactId>directmemory-cache</artifactId>
      <version>0.2</version>
      <optional>true</optional>
    </dependency>

    <!-- OAK-1768 added as short term workaround -->
    <dependency>
      <groupId>org.mapdb</groupId>
      <artifactId>mapdb</artifactId>
      <version>1.0.6</version>
    </dependency>

    <!-- JCR and Jackrabbit dependencies -->
    <dependency>
      <groupId>javax.jcr</groupId>
      <artifactId>jcr</artifactId>
      <version>2.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>jackrabbit-api</artifactId>
      <version>${jackrabbit.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>jackrabbit-jcr-commons</artifactId>
      <version>${jackrabbit.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>jackrabbit-data</artifactId>
      <version>${jackrabbit.version}</version>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>commons-dbcp</groupId>
      <artifactId>commons-dbcp</artifactId>
      <version>1.4</version>
    </dependency>

    <!-- Logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>

    <!-- Findbugs annotations -->
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
    </dependency>

    <!-- Test Dependencies -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>1.9.5</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jul-to-slf4j</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.jackrabbit</groupId>
      <artifactId>oak-blob</artifactId>
      <version>${project.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <version>${h2.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>
