<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>de.cuioss.sheriff.oauth</groupId>
        <artifactId>oauth-sheriff-parent</artifactId>
        <version>0.4.1</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>benchmarking</artifactId>
    <packaging>pom</packaging>
    <name>OAuth Sheriff Benchmarking Parent</name>
    <description>Parent module for all benchmarking related modules including library and integration benchmarks</description>

    <modules>
        <module>benchmarking-common</module>
        <module>benchmark-core</module>
        <module>benchmark-integration-wrk</module>
    </modules>

    <properties>
        <maven.jar.plugin.automatic.module.name>de.cuioss.sheriff.oauth.benchmarking</maven.jar.plugin.automatic.module.name>
        <!-- JMH version for benchmarking -->
        <version.jmh>1.37</version.jmh>
        <!-- External dependency versions -->
        <version.gson>2.13.2</version.gson>
        <version.hdrhistogram>2.2.2</version.hdrhistogram>
        <version.commons-io>2.21.0</version.commons-io>
        <!-- Skip benchmarks by default -->
        <skip.benchmark>true</skip.benchmark>

        <!-- Sonar configuration: Skip analysis for benchmarking modules -->
        <!-- Benchmarking code is for performance testing, not production code -->
        <sonar.skip>true</sonar.skip>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.openjdk.jmh</groupId>
                <artifactId>jmh-core</artifactId>
                <version>${version.jmh}</version>
            </dependency>
            <dependency>
                <groupId>org.openjdk.jmh</groupId>
                <artifactId>jmh-generator-annprocess</artifactId>
                <version>${version.jmh}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>${version.gson}</version>
            </dependency>
            <dependency>
                <groupId>org.hdrhistogram</groupId>
                <artifactId>HdrHistogram</artifactId>
                <version>${version.hdrhistogram}</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${version.commons-io}</version>
            </dependency>
                <dependency>
                    <groupId>de.cuioss.sheriff.oauth</groupId>
                    <artifactId>oauth-sheriff-bom</artifactId>
                    <version>${project.version}</version>
                    <type>pom</type>
                    <scope>import</scope>
                </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <configuration>
                        <skip>${skip.benchmark}</skip>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>copy-dependencies</id>
                            <phase>package</phase>
                            <goals>
                                <goal>copy-dependencies</goal>
                            </goals>
                            <configuration>
                                <outputDirectory>${project.build.directory}/dependency</outputDirectory>
                                <overWriteReleases>false</overWriteReleases>
                                <overWriteSnapshots>false</overWriteSnapshots>
                                <overWriteIfNewer>true</overWriteIfNewer>
                                <includeScope>runtime</includeScope>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>benchmark</id>
            <properties>
                <skip.benchmark>false</skip.benchmark>
            </properties>
        </profile>
    </profiles>
</project>