<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~
  ~ Copyright 2015-2018 Vladimir Bukhtoyarov
  ~
  ~       Licensed 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>

    <groupId>com.github.vladimir-bukhtoyarov</groupId>
    <version>4.0.1</version>
    <artifactId>bucket4j-parent</artifactId>
    <packaging>pom</packaging>
    <name>bucket4j-parent</name>

    <description>bucket4j - is a java implementation of token bucket algorithm for rate limiting</description>
    <url>http://github.com/vladimir-bukhtoyarov/bucket4j</url>

    <distributionManagement>
        <repository>
            <id>vladimir-bukhtoyarov-bintray-repo</id>
            <url>https://api.bintray.com/maven/vladimir-bukhtoyarov/maven/bucket4j-parent/</url>
        </repository>
    </distributionManagement>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <benchmark.jar.name>benchmarks</benchmark.jar.name>
        <sonar.jacoco.reportPath>${project.basedir}/../bucket4j-parent/target/jacoco-merged.exec</sonar.jacoco.reportPath>
        <argLine/>
        <jcache.version>1.0.0</jcache.version>
        <ignite.version>2.1.0</ignite.version>
        <hazelcast.version>3.8</hazelcast.version>
        <infinispan.version>9.1.0.Final</infinispan.version>
        <testcontainers.version>1.6.0</testcontainers.version>
        <lettuce-version>5.0.2.RELEASE</lettuce-version>
    </properties>

    <scm>
        <url>http://github.com/vladimir-bukhtoyarov/bucket4j</url>
        <connection>scm:git:git@github.com:vladimir-bukhtoyarov/bucket4j</connection>
        <developerConnection>scm:git:git@github.com:vladimir-bukhtoyarov/bucket4j.git</developerConnection>
    </scm>

    <developers>
        <developer>
            <id>vladimir-bukhtoyarov</id>
            <name>Vladimir Bukhtoyarov</name>
            <email>jsecoder@mail.ru</email>
            <url>https://github.com/vladimir-bukhtoyarov</url>
            <organization>DINS</organization>
            <organizationUrl>http://www.dins.ru/</organizationUrl>
            <roles>
                <role>Principal software developer</role>
            </roles>
        </developer>
    </developers>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.gmavenplus</groupId>
                <artifactId>gmavenplus-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <testSources>
                        <testSource>
                            <directory>${project.basedir}/src/test/java</directory>
                            <includes>
                                <include>**/*.groovy</include>
                            </includes>
                        </testSource>
                    </testSources>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.20</version>
                <configuration>
                    <includes>
                        <include>**/*Test.class</include>
                        <include>**/*Specification.class</include>
                    </includes>
                    <!-- Travis build workaround -->
                    <argLine>-Xms1024m -Xmx2048m</argLine>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>bintray</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>coverage</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>agent-for-ut</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                                <configuration>
                                    <append>true</append>
                                    <destFile>${sonar.jacoco.reportPath}</destFile>
                                </configuration>
                            </execution>
                            <execution>
                                <id>jacoco-site</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>report</goal>
                                    <goal>report-aggregate</goal>
                                </goals>
                                <configuration>
                                    <dataFile>${sonar.jacoco.reportPath}</dataFile>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.20</version>
                        <configuration>
                            <argLine>@{argLine} -Xms1024m -Xmx2048m</argLine>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>
        <!-- Test dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.spockframework</groupId>
            <artifactId>spock-core</artifactId>
            <version>1.0-groovy-2.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>2.4.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib-nodep</artifactId>
            <version>3.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.gridkit.lab</groupId>
            <artifactId>nanocloud</artifactId>
            <version>0.8.12</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

</project>