<?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</groupId>
    <artifactId>apache</artifactId>
    <version>13</version>
    <relativePath />
  </parent>

  <groupId>org.apache.jackrabbit</groupId>
  <artifactId>oak-parent</artifactId>
  <name>Oak Parent POM</name>
  <version>1.2.2</version>
  <packaging>pom</packaging>

  <properties>
    <test.opts.memory>-Xmx512m -XX:MaxPermSize=64m</test.opts.memory>
    <test.opts>${test.opts.coverage} ${test.opts.memory} -XX:+HeapDumpOnOutOfMemoryError -Dupdate.limit=100 -Djava.awt.headless=true</test.opts>
    <skip.deployment>false</skip.deployment>
    <skip.coverage>true</skip.coverage>
    <known.issues />
    <project.reporting.outputEncoding>
      ${project.build.sourceEncoding}
    </project.reporting.outputEncoding>
    <jackrabbit.version>2.10.0</jackrabbit.version>
    <mongo.host>127.0.0.1</mongo.host>
    <mongo.port>27017</mongo.port>
    <mongo.db>MongoMKDB</mongo.db>
    <mongo.db2>MongoMKDB2</mongo.db2>
    <segment.db>SegmentMK</segment.db>
    <lucene.version>4.7.1</lucene.version>
    <!-- Note that we're using SLF4J API version 1.7 when compiling     -->
    <!-- core Oak components but more recent SLF4J and Logback versions -->
    <!-- when compiling and running test cases and the oak-run jar.     -->
    <!-- This way it's possible to use Oak also in environments that    -->
    <!-- only provide SLF4J version 1.7, while still using a more       -->
    <!-- recent version (if required) when we are in control the runtime environment. -->
    <slf4j.api.version>1.7.6</slf4j.api.version>
    <slf4j.version>1.7.6</slf4j.version> <!-- sync with logback version -->
    <logback.version>1.1.0</logback.version>
    <h2.version>1.4.185</h2.version>
    <findbugs.version>3.0.0</findbugs.version>

   <!-- specifies on which fixture to run the integration testing tests. 
      override in profiles or provide from command line to change behaviour. Provide 
      more fixtures space separated. See org.apache.jackrabbit.oak.jcr.FixturesHelper#AVAILABLE_FIXTURES 
      for the possible values: SEGMENT_MK DOCUMENT_NS DOCUMENT_RDB -->
    <fixtures>SEGMENT_MK</fixtures>

   <!-- whether skip the surefire unit testing during the integration testing. 
      Override with -Dsurefire.skip.ut=true when needed -->
    <surefire.skip.ut>false</surefire.skip.ut>
  </properties>

  <issueManagement>
    <system>Jira</system>
    <url>http://issues.apache.org/jira/browse/OAK</url>
  </issueManagement>

  <url>http://jackrabbit.apache.org/</url>
  <inceptionYear>2012</inceptionYear>
  <description>
    The goal of the Oak effort within the Apache Jackrabbit™ project is
    to implement a scalable and performant hierarchical content repository
    for use as the foundation of modern world-class web sites and other
    demanding content applications.
  </description>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <configuration>
            <target>1.6</target>
            <source>1.6</source>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <configuration>
            <source>1.6</source>
            <links>
              <link>http://docs.oracle.com/javase/6/docs/api/</link>
              <link>http://www.day.com/specs/javax.jcr/javadocs/jcr-2.0/</link>
            </links>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <version>2.5.0</version>
          <extensions>true</extensions>
          <inherited>true</inherited>
          <configuration>
            <obrRepository>NONE</obrRepository>
            <instructions>
              <Bundle-Category>oak</Bundle-Category>
              <Bundle-DocURL>
                http://jackrabbit.apache.org/oak/
              </Bundle-DocURL>
              <Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
            </instructions>
          </configuration>
          <executions>
            <execution>
              <id>baseline</id>
              <goals>
                <goal>baseline</goal>
              </goals>
              <configuration>
                <logResults>false</logResults>
                <failOnWarning>false</failOnWarning>
                <failOnError>false</failOnError>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-scr-plugin</artifactId>
          <version>1.16.0</version>
          <executions>
            <execution>
              <id>generate-scr-scrdescriptor</id>
              <goals>
                <goal>scr</goal>
              </goals>
              <configuration>
                <properties>
                  <service.vendor>The Apache Software Foundation</service.vendor>
                </properties>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <configuration>
            <skip>${skip.deployment}</skip>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <configuration>
            <autoVersionSubmodules>true</autoVersionSubmodules>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.rat</groupId>
          <artifactId>apache-rat-plugin</artifactId>
          <version>0.11</version>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <configuration>
            <argLine>${test.opts}</argLine>
            <systemPropertyVariables>
              <known.issues>${known.issues}</known.issues>
              <mongo.host>${mongo.host}</mongo.host>
              <mongo.port>${mongo.port}</mongo.port>
              <mongo.db>${mongo.db}</mongo.db>
              <mongo.db2>${mongo.db2}</mongo.db2>
              <segment.db>${segment.db}</segment.db>
              <nsfixtures>${fixtures}</nsfixtures>
            </systemPropertyVariables>
            <redirectTestOutputToFile>true</redirectTestOutputToFile>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-failsafe-plugin</artifactId>
          <configuration>
            <argLine>${test.opts}</argLine>
            <systemPropertyVariables>
              <known.issues>${known.issues}</known.issues>
              <mongo.host>${mongo.host}</mongo.host>
              <mongo.port>${mongo.port}</mongo.port>
              <mongo.db>${mongo.db}</mongo.db>
              <mongo.db2>${mongo.db2}</mongo.db2>
              <nsfixtures>${fixtures}</nsfixtures>
            </systemPropertyVariables>
          </configuration>
        </plugin>
          <plugin>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <version>2.11</version>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
          </plugin>
        <!-- This plugin's configuration is used to store Eclipse m2e      -->
        <!-- settings only. It has no influence on the Maven build itself. -->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-scr-plugin</artifactId>
                    <versionRange>[1.7.4,)</versionRange>
                    <goals>
                      <goal>scr</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <execute />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <versionRange>[1.7,)</versionRange>
                    <goals>
                      <goal>reserve-network-port</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <execute />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <versionRange>[0.7.1.201405082137,)</versionRange>
                    <goals>
                      <goal>prepare-agent</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.3</version>
          <configuration>
            <generateReports>false</generateReports>
            <skip>true</skip>
            <skipDeploy>true</skipDeploy>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>org.apache.maven.doxia</groupId>
              <artifactId>doxia-module-markdown</artifactId>
              <version>1.5</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-scm-publish-plugin</artifactId>
          <version>1.0-beta-2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>2.4</version>
        </plugin>
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>0.7.1.201405082137</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>pre-unit-test</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
            <configuration>
              <skip>${skip.coverage}</skip>
              <destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile>
              <propertyName>test.opts.coverage</propertyName>
            </configuration>
          </execution>
          <execution>
            <id>post-unit-test</id>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
            <configuration>
              <skip>${skip.coverage}</skip>
              <dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</dataFile>
              <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <!--avoid child modules from inheriting anything from the apache parent pom -->
        <inherited>false</inherited>
      </plugin>
    </plugins>
  </reporting>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.core</artifactId>
        <version>4.2.0</version>
      </dependency>
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.compendium</artifactId>
        <version>4.2.0</version>
      </dependency>
      <dependency>
        <groupId>biz.aQute.bnd</groupId>
        <artifactId>bndlib</artifactId>
        <version>2.2.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.felix</groupId>
        <artifactId>org.apache.felix.scr.annotations</artifactId>
        <version>1.9.6</version>
      </dependency>
      <dependency>
        <groupId>com.google.code.findbugs</groupId>
        <artifactId>jsr305</artifactId>
        <version>2.0.0</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.10</version>
      </dependency>
      <dependency>
        <groupId>org.mongodb</groupId>
        <artifactId>mongo-java-driver</artifactId>
        <version>2.13.0</version>
      </dependency>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>15.0</version>
      </dependency>
      <dependency>
        <groupId>org.easymock</groupId>
        <artifactId>easymock</artifactId>
        <version>3.1</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.api.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>log4j-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jul-to-slf4j</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>${logback.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.jclouds.provider</groupId>
        <artifactId>aws-s3</artifactId>
        <version>1.7.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.sling</groupId>
        <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
        <version>1.2.0</version>
        <scope>test</scope>
        <exclusions>
          <!-- Need to exclude it due to SLING-4470 -->
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.6</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <profiles>
    <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  Unit testing profiles -->
    <profile>
         <id>unittesting</id>
         <properties>
            <!-- emptying $fixtures means run on all -->
            <fixtures />
         </properties>
         <build>
            <plugins>
              <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
              </plugin>
            </plugins>
         </build>
    </profile>
    <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Integration testing profiles -->
    <profile>
      <!-- runs all the IT agains the default fixture. See <properties> section -->
      <id>integrationTesting</id>
      <activation>
        <property>
          <name>env.OAK_INTEGRATION_TESTING</name>
        </property>
      </activation>
      <build>
        <plugins>
           <plugin>
             <artifactId>maven-surefire-plugin</artifactId>
             <configuration>
               <skipTests>${surefire.skip.ut}</skipTests>
             </configuration>
           </plugin>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - other profiles -->
    <profile>
      <id>pedantic</id>
      <build>
        <plugins>
           <plugin>
             <artifactId>maven-surefire-plugin</artifactId>
             <configuration>
               <!-- run a test to prevent Jenkins from failing because no test ran -->
               <test>PathUtilsTest</test>
               <failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
             </configuration>
           </plugin>
          <plugin>
            <groupId>org.apache.rat</groupId>
            <artifactId>apache-rat-plugin</artifactId>
            <executions>
              <execution>
                <phase>verify</phase>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <configuration>
              <failOnViolation>false</failOnViolation>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
            <version>${findbugs.version}</version>
            <configuration>
              <failOnError>false</failOnError>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>check</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>rdb-mysql</id>
      <dependencies>
        <dependency>
          <groupId>mysql</groupId>
          <artifactId>mysql-connector-java</artifactId>
          <version>5.1.34</version>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>rdb-postgres</id>
      <dependencies>
        <dependency>
          <groupId>org.postgresql</groupId>
          <artifactId>postgresql</artifactId>
          <version>9.4-1201-jdbc4</version>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>rdb-h2</id>
      <dependencies>
        <dependency>
          <groupId>com.h2database</groupId>
          <artifactId>h2</artifactId>
          <version>${h2.version}</version>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <!-- requires local copy of MS SqlServer JDBC driver deployed to Maven repo-->
      <!-- for instance:
        mvn install:install-file -Dfile=sqljdbc41.jar -Dpackaging=jar\
          -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.1
       -->
      <id>rdb-mssql</id>
      <dependencies>
        <dependency>
          <groupId>com.microsoft.sqlserver</groupId>
          <artifactId>sqljdbc4</artifactId>
          <version>4.1</version>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <!-- requires local copy of Oracle JDBC driver deployed to Maven repo-->
      <!-- for instance:
        mvn install:install-file -Dfile=ojdbc6.jar -Dpackaging=jar\
          -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.3.0
       -->
      <id>rdb-oracle</id>
      <dependencies>
        <dependency>
          <groupId>com.oracle</groupId>
          <artifactId>ojdbc6</artifactId>
          <version>11.2.0.3.0</version>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <!-- requires local copy of IBM DB2 JDBC drivers deployed to Maven repo-->
      <!-- for instance:
        mvn install:install-file -Dfile=db2jcc4.jar -Dpackaging=jar\
          -DgroupId=com.ibm.db2 -DartifactId=db2 -Dversion=4.16.53
        mvn install:install-file -Dfile=db2jcc_license_cu.jar -Dpackaging=jar\
          -DgroupId=com.ibm.db2 -DartifactId=db2-license -Dversion=4.16.53
       -->
      <id>rdb-db2</id>
      <dependencies>
        <dependency>
          <groupId>com.ibm.db2</groupId>
          <artifactId>db2</artifactId>
          <version>4.16.53</version>
        </dependency>
        <dependency>
          <groupId>com.ibm.db2</groupId>
          <artifactId>db2-license</artifactId>
          <version>4.16.53</version>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>java8</id>
      <activation>
        <jdk>[1.8,)</jdk>
      </activation>
      <properties>
        <test.opts.memory>-Xmx512m</test.opts.memory>
      </properties>
    </profile>
    <profile>
      <id>coverage</id>
      <properties>
        <skip.coverage>false</skip.coverage>
      </properties>
    </profile>

    <profile>
      <id>findbugs-jdk6</id>
      <activation>
        <jdk>1.6</jdk>
      </activation>
      <properties>
        <findbugs.version>2.5.5</findbugs.version>
      </properties>
    </profile>
  </profiles>

  <scm>
    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/pom/tags/jackrabbit-oak-1.2.2/oak-parent</connection>
    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/pom/tags/jackrabbit-oak-1.2.2/oak-parent</developerConnection>
    <url>http://svn.apache.org/viewvc/maven/pom/tags/jackrabbit-oak-1.2.2/oak-parent</url>
  </scm>
</project>
