<?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/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.apache.sling</groupId>
        <artifactId>sling</artifactId>
        <version>26</version>
        <relativePath />
    </parent>

    <artifactId>org.apache.sling.nosql.mongodb-resourceprovider</artifactId>
    <version>1.1.0</version>
    <packaging>bundle</packaging>
  
    <name>Apache Sling NoSQL MongoDB Resource Provider</name>
    <description>Resource Provider with MongoDB Persistence for Apache Sling.</description>
  
    <scm>
        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.nosql.mongodb-resourceprovider-1.1.0</connection>
        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.nosql.mongodb-resourceprovider-1.1.0</developerConnection>
        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.nosql.mongodb-resourceprovider-1.1.0</url>
    </scm>

    <properties>
        <sling.java.version>7</sling.java.version>
    </properties>
  
    <dependencies>
  
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.nosql.generic</artifactId>
            <version>1.1.0</version>
            <scope>provided</scope>
        </dependency>
    
        <dependency>
            <groupId>org.mongodb</groupId>
            <artifactId>mongo-java-driver</artifactId>
            <version>3.1.1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.commons.osgi</artifactId>
            <version>2.2.2</version>
            <scope>provided</scope>
        </dependency>
  
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.testing.sling-mock</artifactId>
            <version>1.5.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.testing.logging-mock</artifactId>
            <version>1.0.0</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.nosql.generic</artifactId>
            <classifier>tests</classifier>
            <version>1.1.0</version>
            <scope>test</scope>
        </dependency>
      
        <dependency>
            <groupId>javax.jcr</groupId>
            <artifactId>jcr</artifactId>
            <version>2.0</version>
            <scope>test</scope>
        </dependency>

    </dependencies>
  
    <build>
        <plugins>
    
          <plugin>
              <groupId>org.apache.felix</groupId>
              <artifactId>maven-bundle-plugin</artifactId>
              <extensions>true</extensions>
          </plugin>
    
          <plugin>
              <groupId>org.apache.felix</groupId>
              <artifactId>maven-scr-plugin</artifactId>
          </plugin>
    
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-plugin</artifactId>
              <configuration>
                  <testFailureIgnore>false</testFailureIgnore>
                  <includes>
                      <include>**/*Test.java</include>
                  </includes>
                  <excludes>
                      <exclude>**/*IT.java</exclude>
                  </excludes>
              </configuration>
          </plugin>
    
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <!-- Extend RAT configuration from parent pom -->
                    <groupId>org.apache.rat</groupId>
                    <artifactId>apache-rat-plugin</artifactId>
                    <configuration>
                        <excludes combine.children="append">
                            <exclude>README.md</exclude>
                        </excludes>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    
    <profiles>
    
      <!-- 
          Profile for Integration tests with a real MongoDB server running.
          You have to set JVM parameters for MongoDB host and bucket name, e.g.
          mvn -Pmongodb-integration-test -DmongodbHosts=localhost:8091 -DbucketName=test integration-test
      -->
      <profile>
        <id>mongodb-integration-test</id>
        <build>
          <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <includes>
                        <include>**/*IT.java</include>
                    </includes>
                    <excludes>
                        <exclude>**/*Test.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
    
          </plugins>
        </build>
      </profile>

    </profiles>
  
</project>