<?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/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>storeconnection-impls</artifactId>
        <groupId>de.adorsys.cryptoutils</groupId>
        <version>0.16.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>mongodbstoreconnection</artifactId>

    <dependencies>
        <dependency>
            <groupId>de.adorsys.cryptoutils</groupId>
            <artifactId>storeconnection-api</artifactId>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>

        <dependency>
            <groupId>org.mongodb</groupId>
            <artifactId>mongodb-driver</artifactId>
            <version>3.6.3</version>
        </dependency>

        <!-- test -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>mongodbstoreconnection</finalName>
        <plugins>
            <plugin>
                <groupId>com.github.os72</groupId>
                <artifactId>protoc-jar-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <excludePackageNames>org.adorsys.encobject.domain.*</excludePackageNames>
                    <show>public</show>
                    <failOnError>false</failOnError>
                </configuration>
            </plugin>

            <!-- Setup IntegrationTests by name -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <!-- Exclude integation tests from standards -->
                    <excludes>
                        <exclude>**/*Test.java</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <!-- Define execution for integration tests. -->
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <phase>integration-test</phase>
                        <configuration>
                            <excludes>
                                <exclude>none</exclude>
                            </excludes>
                            <includes>
                                <include>**/*Test.java</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!-- see https://github.com/joelittlejohn/embedmongo-maven-plugin -->
                <groupId>com.github.joelittlejohn.embedmongo</groupId>
                <artifactId>embedmongo-maven-plugin</artifactId>
                <version>0.3.5</version>
                <executions>
                    <execution>
                        <id>start</id>
                        <goals>
                            <goal>start</goal>
                        </goals>
                        <configuration>
                            <version>3.4.13</version>
                            <!-- optional, default 27017 <port>37017</port> -->
                            <!-- optional, default is false, if true allocates a random port and overrides embedmongo.port <randomPort>true</randomPort> -->
                            <!-- optional, default 2.2.1 -->
                            <!-- optional, default is a new dir in java.io.tmpdir -->
                            <databaseDirectory>target/mongotest</databaseDirectory>
                            <!-- optional (file|console|none), default console <logging>file</logging> -->
                            <!-- optional, can be used when logging=file, default is ./embedmongo.log <logFile>${project.build.directory}/myfile.log</logFile> -->
                            <!-- optional, can be used when logging=file, default is utf-8 <logFileEncoding>utf-8</logFileEncoding> -->
                            <!-- optional, default is to listen on all interfaces <bindIp>127.0.0.1</bindIp> -->
                            <!-- optional, default is http://fastdl.mongodb.org/ <downloadPath>http://internal-mongo-repo/</downloadPath> -->
                            <!-- optional, default is /tmp <unixSocketPrefix>${user.home}/.embedmongo</unixSocketPrefix> -->
                            <!-- optional, one of wiredTiger or mmapv1 (default is mmapv1) <storageEngine>wiredTiger</storageEngine> -->
                            <!-- optional, skips this plugin entirely, use on the command line like -Dembedmongo.skip <skip>false</skip> -->
                        </configuration>
                    </execution>
                    <execution>
                        <id>stop</id>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

    </build>

</project>