<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2016 Milad Naseri
  ~
  ~ Permission is hereby granted, free of charge, to any person obtaining a copy of this
  ~ software and associated documentation files (the "Software"), to deal in the Software
  ~ without restriction, including without limitation the rights to use, copy, modify, merge,
  ~ publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
  ~ to whom the Software is furnished to do so, subject to the following conditions:
  ~
  ~ The above copyright notice and this permission notice shall be included in all copies or
  ~ substantial portions of the Software.
  ~
  ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  ~ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  ~ PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
  ~ FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  ~ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  ~ SOFTWARE.
  -->

<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>

    <groupId>com.mmnaseri.utils</groupId>
    <artifactId>spring-data-mock</artifactId>
    <version>2.2.0</version>

    <name>Spring Data Mock</name>
    <description>A framework for mocking Spring Data repositories</description>
    <url>https://mmnaseri.github.io/spring-data-mock</url>
    <inceptionYear>2014</inceptionYear>
    <licenses>
        <license>
            <name>MIT</name>
            <url>http://mit-license.org</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Milad Naseri</name>
            <email>mmnaseri@programmer.net</email>
            <url>http://www.mmnaseri.com</url>
            <roles>
                <role>designer</role>
                <role>developer</role>
            </roles>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:mmnaseri/spring-data-mock.git</connection>
        <developerConnection>scm:git:git@github.com:mmnaseri/spring-data-mock.git</developerConnection>
        <url>git@github.com:mmnaseri/spring-data-mock.git</url>
    </scm>
    <issueManagement>
        <system>Github</system>
        <url>https://github.com/mmnaseri/spring-data-mock/issues</url>
    </issueManagement>

    <properties>
        <!-- build integrity -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
        <target-jdk.version>1.8</target-jdk.version>
        <!-- requirements -->
        <commons-logging.version>1.2</commons-logging.version>
        <!-- test -->
        <testng.version>7.1.0</testng.version>
        <hamcrest.version>1.3</hamcrest.version>
        <!-- deployment -->
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
        <cobertura-maven-plugin.version>2.7</cobertura-maven-plugin.version>
        <coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
        <!-- feature support -->
        <spring-data-commons.version>2.4.5</spring-data-commons.version>
        <spring-data-gemfire.version>2.3.7.RELEASE</spring-data-gemfire.version>
        <spring-data-jpa.version>2.4.4</spring-data-jpa.version>
        <spring-data-mongo.version>3.1.5</spring-data-mongo.version>
        <querydsl.version>4.4.0</querydsl.version>
        <cglib.version>3.3.0</cglib.version>
        <ecj.version>3.24.0</ecj.version>
        <persistence-api.version>1.0.2</persistence-api.version>
    </properties>

    <dependencies>
        <!-- dependencies that are required for the runtime functionality of this framework-->
        <dependency>
            <!-- logging the workings of the framework -->
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>${commons-logging.version}</version>
        </dependency>
        <dependency>
            <!-- Required for supporting QueryDSL mocks -->
            <groupId>org.eclipse.jdt</groupId>
            <artifactId>ecj</artifactId>
            <version>${ecj.version}</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <!-- Required for supporting QueryDSL mocks -->
            <groupId>com.querydsl</groupId>
            <artifactId>querydsl-collections</artifactId>
            <version>${querydsl.version}</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <!-- Required by QueryDSL collections -->
            <groupId>cglib</groupId>
            <artifactId>cglib-nodep</artifactId>
            <version>${cglib.version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- dependencies that are required for testing the framework -->
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>${testng.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>${hamcrest.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.persistence</groupId>
            <artifactId>persistence-api</artifactId>
            <version>${persistence-api.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- dependencies for adding support for various features of the spring data ecosystem -->
        <dependency>
            <!-- Spring Data Commons -->
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-commons</artifactId>
            <version>${spring-data-commons.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <!-- Spring Data support for JPA-->
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-jpa</artifactId>
            <version>${spring-data-jpa.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <!-- Spring Data support for JPA-->
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-mongodb</artifactId>
            <version>${spring-data-mongo.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <!-- Support for QueryDSL supported repositories -->
            <groupId>com.querydsl</groupId>
            <artifactId>querydsl-core</artifactId>
            <version>${querydsl.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <!-- Support for Spring Data GemFire -->
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-gemfire</artifactId>
            <version>${spring-data-gemfire.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <source>${target-jdk.version}</source>
                    <target>${target-jdk.version}</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <distributionManagement>
                <repository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
                </repository>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
            </distributionManagement>
            <build>
                <plugins>
                    <!-- for signing the artifacts using the GPG signature -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <configuration>
                            <!-- Must run with -Dgpg.passphrase=... to succeed -->
                            <executable>gpg2</executable>
                            <gpgArguments>
                                <arg>--batch</arg>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- to generate javadoc JAR -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven-javadoc-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- to generate sources JAR -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- sets up the deployment -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <version>${maven-deploy-plugin.version}</version>
                        <configuration>
                            <repositoryId>ossrh</repositoryId>
                        </configuration>
                    </plugin>
                    <!-- To do Nexus staging -->
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus-staging-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>coverage</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>cobertura-maven-plugin</artifactId>
                        <version>${cobertura-maven-plugin.version}</version>
                        <configuration>
                            <format>xml</format>
                            <maxmem>256m</maxmem>
                            <!-- aggregated reports for multi-module projects -->
                            <aggregate>true</aggregate>
                            <check/>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.eluder.coveralls</groupId>
                        <artifactId>coveralls-maven-plugin</artifactId>
                        <version>${coveralls-maven-plugin.version}</version>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>coverage-local</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>cobertura-maven-plugin</artifactId>
                        <version>${cobertura-maven-plugin.version}</version>
                        <configuration>
                            <format>xml</format>
                            <maxmem>256m</maxmem>
                            <!-- aggregated reports for multi-module projects -->
                            <aggregate>true</aggregate>
                            <check/>
                            <outputDirectory>target/reports</outputDirectory>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>