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

    <parent>
        <groupId>com.mulesoft.mule.framework</groupId>
        <artifactId>micro-bechmarks-parent</artifactId>
        <version>1.2.1</version>
    </parent>

    <artifactId>micro-bechmarks-static</artifactId>

    <name>Mule Static Framework Micro-Bechmarks</name>
    <description>Mule Static Framework Micro-Bechmarks</description>
    
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>properties</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    
    <profiles>
        <profile>
            <id>performance</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <configuration>
                            <classpathScope>test</classpathScope>
                            <executable>java</executable>
                            <workingDirectory>${basedir}/target</workingDirectory>
                            <arguments>
                                <argument>-classpath</argument>
                                <classpath />

                                <argument>-DframeworkTestBomVersion=${project.version}</argument>
                                <argument>-Dmule.framework.services.bundle.dir=${project.build.directory}/dependency/mule-framework-static-requirements-bundle-${project.version}/services</argument>
                                <mainClass>org.openjdk.jmh.Main</mainClass>
                                <!--Run only a certain class-->
                                <argument>${jmh.benchmark}</argument>
                                <!--Create json report-->
                                <argument>-rf</argument>
                                <argument>json</argument>
                                <!--Number of Iterations-->
                                <argument>-i</argument>
                                <argument>10</argument>
                                <!--Number of Warmup Iterations-->
                                <argument>-wi</argument>
                                <argument>10</argument>
                                <!--Number of forks-->
                                <argument>-f</argument>
                                <argument>1</argument>
                            </arguments>
                        </configuration>
                        <executions>
                            <execution>
                                <id>run-benchmarks</id>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <groupId>com.mulesoft.mule.framework</groupId>
            <artifactId>mule-framework-bom</artifactId>
            <version>${project.version}</version>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.mule.framework</groupId>
            <artifactId>mule-framework-test-utils</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.mule.framework</groupId>
            <artifactId>mule-framework-static-requirements-bundle</artifactId>
            <type>zip</type>
            <version>${project.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.mule.framework</groupId>
            <artifactId>mule-framework-test-connectors-resolver</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
        </dependency>

        <dependency>
            <groupId>org.openjdk.jmh</groupId>
            <artifactId>jmh-core</artifactId>
        </dependency>
    </dependencies>
</project>
