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

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.bucket4j</groupId>
    <version>8.10.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/bucket4j/bucket4j</url>

    <distributionManagement>
        <snapshotRepository>
            <id>bucket4j-ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>bucket4j-ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</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>
        <modular-name>parent</modular-name>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <VERSION-FOR-REVAPI-COMPARISION>4.10.0</VERSION-FOR-REVAPI-COMPARISION>

        <benchmark.jar.name>benchmarks</benchmark.jar.name>
        <argLine/>
        <maven.build.timestamp.format>yyyy-MM-dd HH</maven.build.timestamp.format>
        <jcache.version>1.0.0</jcache.version>
        <ignite.version>2.10.0</ignite.version>

        <hazelcast.4.version>4.1</hazelcast.4.version>
        <hazelcast.latest.version>5.3.6</hazelcast.latest.version>

        <infinispan-8.version>8.2.12.Final</infinispan-8.version>
        <infinispan.latest.version>11.0.1.Final</infinispan.latest.version>
        <ehcache.version>3.8.1</ehcache.version>

        <testcontainers.version>1.18.1</testcontainers.version>
        <lettuce-version>5.0.2.RELEASE</lettuce-version>
        <jedis.version>4.4.6</jedis.version>
        <redisson.version>3.21.0</redisson.version>
        <lettuce.version>6.1.8.RELEASE</lettuce.version>
        <caffeine.version>2.9.3</caffeine.version>
        <mssql.version>12.4.2.jre8</mssql.version>
        <ojdbc.version>23.2.0.0</ojdbc.version>
    </properties>

    <scm>
        <url>http://github.com/bucket4j/bucket4j</url>
        <connection>scm:git:git@github.com:bucket4j/bucket4j</connection>
        <developerConnection>scm:git:git@github.com:bucket4j/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>edna</organization>
            <organizationUrl>https://edna.ru/</organizationUrl>
            <roles>
                <role>Software developer</role>
            </roles>
        </developer>
        <developer>
            <id>MaxBartkov</id>
            <name>Maxim Bartkov</name>
            <email>maxgalayoutop@gmail.com</email>
            <url>https://github.com/MaxBartkov</url>
            <organization>Jaja finance</organization>
            <organizationUrl>https://jaja.co.uk</organizationUrl>
            <roles>
                <role>Java Technical Leader</role>
            </roles>
        </developer>
    </developers>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                        <manifestEntries>
                            <Automatic-Module-Name>io.github.bucket4j.${modular-name}</Automatic-Module-Name>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <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.8.1</version>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                    <compilerArgument>-parameters</compilerArgument>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <includes>
                        <include>**/*Test.class</include>
                        <include>**/*Specification.class</include>
                    </includes>
                    <systemPropertyVariables>
                        <logback.configurationFile>${basedir}/src/test/resources/logback-test.xml</logback.configurationFile>
                    </systemPropertyVariables>
                    <!-- Travis build workaround -->
                    <argLine>-Xms1024m -Xmx2048m</argLine>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.junit.jupiter</groupId>
                        <artifactId>junit-jupiter-engine</artifactId>
                        <version>5.9.3</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>flatten-maven-plugin</artifactId>
                <version>1.2.1</version>
                <configuration>
                    <flattenMode>oss</flattenMode>
                </configuration>
                <executions>
                    <!-- enable flattening -->
                    <execution>
                        <id>flatten</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>flatten</goal>
                        </goals>
                    </execution>
                    <!-- ensure proper cleanup -->
                    <execution>
                        <id>flatten.clean</id>
                        <phase>clean</phase>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0-M3</version>
                <configuration>
                    <rules>
                        <banDuplicatePomDependencyVersions/>
                        <dependencyConvergence/>
                    </rules>
                    <fail>false</fail>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.revapi</groupId>
                <artifactId>revapi-maven-plugin</artifactId>
                <version>0.12.1</version>
                <dependencies>
                    <dependency>
                        <groupId>org.revapi</groupId>
                        <artifactId>revapi-java</artifactId>
                        <version>0.22.0</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <alwaysCheckForReleaseVersion>false</alwaysCheckForReleaseVersion>
                    <oldArtifacts>
                        <artifact>${project.groupId}:${project.artifactId}:${VERSION-FOR-REVAPI-COMPARISION}</artifact>
                    </oldArtifacts>
                    <newArtifacts>
                        <artifact>${project.groupId}:${project.artifactId}:${project.version}</artifact>
                    </newArtifacts>
                    <analysisConfiguration>
                    </analysisConfiguration>
                </configuration>
                <executions>
                    <execution>
                        <id>verify-compatibility</id>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <!-- See documentation there https://central.sonatype.org/pages/apache-maven.html -->
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh-bucket4j</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                            <stagingProgressTimeoutMinutes>120</stagingProgressTimeoutMinutes>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <version>2.0.0</version>
                        <configuration>
<!--                            <licenseName>bucket4_license</licenseName>-->
<!--                            <licenseResolver>${project.baseUri}/src/license</licenseResolver>-->
                            <inceptionYear>2015</inceptionYear>
                            <organizationName>Vladimir Bukhtoyarov</organizationName>
                            <projectName>Bucket4j</projectName>
                            <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
                            <processStartTag>========================LICENSE_START=================================</processStartTag>
                            <processEndTag>=========================LICENSE_END==================================</processEndTag>
                        </configuration>
                        <executions>
                            <execution>
                                <id>update-file-license-header</id>
                                <goals>
                                    <goal>update-file-header</goal>
                                </goals>
                                <phase>process-sources</phase>
                                <configuration>
                                    <licenseName>apache_v2</licenseName>
                                    <roots>
                                        <root>src/main/java</root>
                                    </roots>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <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>
                        <version>3.4.0</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <additionalOptions>-Xdoclint:none</additionalOptions>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <reporting>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <version>2.0.0</version>
                    </plugin>
                </plugins>
            </reporting>
        </profile>
        <profile>
            <id>coverage</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.8.5</version>
                        <executions>
                            <execution>
                                <id>prepare-agent</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>report</goal>
                                    <goal>report-aggregate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>3.1.0</version>
                        <configuration>
                            <argLine>@{argLine} -Xms1024m -Xmx2048m</argLine>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>
        <!-- Test dependencies -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.9.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>5.9.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>5.9.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.spockframework</groupId>
            <artifactId>spock-core</artifactId>
            <version>2.1-groovy-2.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy</artifactId>
            <version>2.5.15</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib-nodep</artifactId>
            <version>3.3.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.gridkit.lab</groupId>
            <artifactId>nanocloud</artifactId>
            <version>0.8.16</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.3.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.13.4.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

</project>
