<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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.mulesoft.connectors</groupId>
    <artifactId>mule-selenium-connector</artifactId>
    <version>2.4.1</version>
    <packaging>mule-extension</packaging>
    <name>Selenium Extension</name>

    <parent>
        <groupId>org.mule.extensions</groupId>
        <artifactId>mule-modules-parent</artifactId>
        <version>1.2.0</version>
    </parent>

    <properties>
        <runtimeVersion>4.3.0-20231026</runtimeVersion>
        <mule.api.version>1.2.1</mule.api.version>
        <mule.sdk.version>1.2.1</mule.sdk.version>
        <min.mule.version>4.3.0-20231026</min.mule.version>
        <runtimeProduct>MULE_EE</runtimeProduct>
        <munit.failIfNoTests>false</munit.failIfNoTests>
        <jacoco.version>0.8.14</jacoco.version>
        <munit.extensions.maven.plugin.version>1.6.1</munit.extensions.maven.plugin.version>
        <munit.version>3.6.3</munit.version>
        <mtf.tools.version>1.2.0</mtf.tools.version>
        <mule.sdk.api.version>0.12.0</mule.sdk.api.version>
        <file.connector.version>1.5.3</file.connector.version>
        <http.connector.version>1.10.6</http.connector.version>
        <configuration.files.s3.folder>${project.artifactId}</configuration.files.s3.folder>
        <configuration.files.vault.secret.engine>connector-credentials</configuration.files.vault.secret.engine>
        <connector.maven.plugin.version>3.0.2</connector.maven.plugin.version>
        <mtf.javaopts></mtf.javaopts>
        <sharepoint.connector.version>3.6.1</sharepoint.connector.version>
        <selenium.java.version>4.13.0</selenium.java.version>
        <netty.transport.version>4.1.132.Final</netty.transport.version>
        <jackson.version>2.18.6</jackson.version>
        <groovy.version>4.0.24</groovy.version>
        <webdrivermanager.version>6.3.3</webdrivermanager.version>
        <aerogear.version>1.0.0</aerogear.version>
        <jakarta.version>2.0.2</jakarta.version>
        <graal.version>21.3.16</graal.version>
        <async.http.client.version>2.12.3</async.http.client.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- Security fixes: upgrade Jackson and Netty to address critical CVEs -->
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-codec-http</artifactId>
                <version>${netty.transport.version}</version>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-codec-http2</artifactId>
                <version>${netty.transport.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>com.mulesoft.munit</groupId>
                <artifactId>munit-extensions-maven-plugin</artifactId>
                <version>${munit.extensions.maven.plugin.version}</version>
                <executions>
                    <execution>
                        <id>test</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <phase>integration-test</phase>
                    </execution>
                </executions>
                <configuration>
                    <argLines>
                        <argLine>
                            -javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile=${session.executionRootDirectory}/target/jacoco-munit.exec -Dgroovy.cache.hashing.algorithm=sha256 -Dgroovy.source.cache=false
                        </argLine>
                    </argLines>
                    <environmentVariables>
                        <!-- Toggles the JDK17 style flag -->
                        <!-- FIPS 140-3 Compliance: Use SHA-256 for Groovy script caching (MD5 not available in FIPS mode) -->
                        <_JAVA_OPTIONS>-XX:+PrintCommandLineFlags -Dgroovy.cache.hashing.algorithm=sha256 -Dgroovy.source.cache=false ${mtf.javaopts}</_JAVA_OPTIONS>
                    </environmentVariables>
                    <runtimeConfiguration>
                        <discoverRuntimes>
                            <minMuleVersion>${runtimeVersion}</minMuleVersion>
                            <includeSnapshots>false</includeSnapshots>
                            <product>EE</product>
                        </discoverRuntimes>
                    </runtimeConfiguration>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.mule.connectors</groupId>
                        <artifactId>mule-file-connector</artifactId>
                        <version>${file.connector.version}</version>
                        <classifier>mule-plugin</classifier>
                    </dependency>
                    <dependency>
                        <groupId>org.mule.connectors</groupId>
                        <artifactId>mule-http-connector</artifactId>
                        <version>${http.connector.version}</version>
                        <classifier>mule-plugin</classifier>
                    </dependency>
                    <dependency>
                        <groupId>com.mulesoft.munit</groupId>
                        <artifactId>munit-runner</artifactId>
                        <version>${munit.version}</version>
                        <classifier>mule-plugin</classifier>
                    </dependency>
                    <dependency>
                        <groupId>com.mulesoft.munit</groupId>
                        <artifactId>munit-tools</artifactId>
                        <version>${munit.version}</version>
                        <classifier>mule-plugin</classifier>
                    </dependency>
                    <dependency>
                        <groupId>com.mulesoft.munit</groupId>
                        <artifactId>mtf-tools</artifactId>
                        <version>${mtf.tools.version}</version>
                        <classifier>mule-plugin</classifier>
                    </dependency>
                    <dependency>
                        <groupId>com.mulesoft.connectors</groupId>
                        <artifactId>mule-sharepoint-connector</artifactId>
                        <version>${sharepoint.connector.version}</version>
                        <classifier>mule-plugin</classifier>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>com.mulesoft.connectors.maven</groupId>
                <artifactId>connector-maven-plugin</artifactId>
                <version>${connector.maven.plugin.version}</version>
                <executions>
                    <execution>
                        <id>get-configuration-files</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>get-configuration-files</goal>
                        </goals>
                        <configuration>
                            <folder>${configuration.files.s3.folder}</folder>
                            <vaultBucket>${configuration.files.vault.secret.engine}</vaultBucket>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.plugin.version}</version>
                <configuration>
                    <skipTests>false</skipTests>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>merge</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>merge</goal>
                        </goals>
                        <configuration>
                            <destFile>${session.executionRootDirectory}/target/jacoco.exec</destFile>
                            <fileSets>
                                <fileSet>
                                    <directory>${project.build.directory}</directory>
                                    <includes>
                                        <include>*.exec</include>
                                    </includes>
                                </fileSet>
                            </fileSets>
                        </configuration>
                    </execution>
                    <execution>
                        <id>report</id>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!-- This is the last selenium version compilable with Java 8 -->
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>${selenium.java.version}</version>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <groupId>io.netty</groupId>
                    <artifactId>netty-transport-native-epoll</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.netty</groupId>
                    <artifactId>netty-transport-native-kqueue</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>2.5</version>
        </dependency>
        <dependency>
            <groupId>org.asynchttpclient</groupId>
            <artifactId>async-http-client</artifactId>
            <version>${async.http.client.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>io.netty</groupId>
                    <artifactId>netty-codec-http</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.netty</groupId>
                    <artifactId>netty-handler</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.netty</groupId>
                    <artifactId>netty-transport-native-epoll</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.netty</groupId>
                    <artifactId>netty-transport-native-kqueue</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.netty</groupId>
                    <artifactId>netty-handler-proxy</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.netty</groupId>
                    <artifactId>netty-codec-socks</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.21.0</version>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-codec-http</artifactId>
            <version>${netty.transport.version}</version>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-codec-socks</artifactId>
            <version>${netty.transport.version}</version>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-handler-proxy</artifactId>
            <version>${netty.transport.version}</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
        <!-- Surefire uses JUnit Platform (via transitive Groovy test stack); Vintage runs JUnit 4 tests. -->
        <dependency>
            <groupId>org.junit.vintage</groupId>
            <artifactId>junit-vintage-engine</artifactId>
            <version>5.11.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>33.5.0-jre</version>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-handler</artifactId>
            <version>${netty.transport.version}</version>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport-native-epoll</artifactId>
            <version>${netty.transport.version}</version>
        </dependency>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-transport-native-kqueue</artifactId>
            <version>${netty.transport.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>${groovy.version}</version>
            <type>pom</type>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.groovy</groupId>
                    <artifactId>groovy-ant</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.github.bonigarcia</groupId>
            <artifactId>webdrivermanager</artifactId>
            <version>${webdrivermanager.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>com.github.docker-java</groupId>
                    <artifactId>docker-java-transport-httpclient5</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.jboss.aerogear</groupId>
            <artifactId>aerogear-otp-java</artifactId>
            <version>${aerogear.version}</version>
        </dependency>
        <dependency>
            <groupId>com.sun.mail</groupId>
            <artifactId>jakarta.mail</artifactId>
            <version>${jakarta.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mule.sdk</groupId>
            <artifactId>mule-sdk-api</artifactId>
            <version>${mule.sdk.api.version}</version>
        </dependency>
        <dependency>
            <groupId>org.graalvm.js</groupId>
            <artifactId>js</artifactId>
            <version>${graal.version}</version>
        </dependency>
        <dependency>
            <groupId>org.graalvm.js</groupId>
            <artifactId>js-scriptengine</artifactId>
            <version>${graal.version}</version>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>mule-releases</id>
            <name>Nexus Public Releases</name>
            <url>https://repository-master.mulesoft.org/nexus/content/repositories/releases/</url>
        </repository>
    </repositories>
</project>
