<?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.atlassian.pom</groupId>
        <artifactId>public-pom</artifactId>
        <version>5.0.29</version>
    </parent>

    <groupId>com.atlassian.selenium</groupId>
    <artifactId>atlassian-selenium-parent</artifactId>
    <version>3.5.0</version>
    <packaging>pom</packaging>

    <name>${project.artifactId}</name>
    <description>A suite of tools to help with Selenium test harness, assertions etc.</description>

    <modules>
        <module>atlassian-pageobjects-api</module>
        <module>atlassian-pageobjects-elements</module>
        <module>atlassian-pageobjects-elements-aui</module>
        <module>atlassian-visual-comparison</module>
        <module>atlassian-webdriver</module>
        <module>selenium-scannable</module>
    </modules>

    <scm>
        <connection>scm:git:ssh://git@bitbucket.org/atlassian/atlassian-selenium.git</connection>
        <developerConnection>scm:git:ssh://git@bitbucket.org/atlassian/atlassian-selenium.git</developerConnection>
        <url>https://bitbucket.org/atlassian/atlassian-selenium/</url>
        <tag>atlassian-selenium-parent-3.5.0</tag>
    </scm>
    <issueManagement>
        <system>JIRA</system>
        <url>https://ecosystem.atlassian.net/browse/SELENIUM</url>
    </issueManagement>
    <ciManagement>
        <system>Bamboo</system>
        <url>https://ecosystem-bamboo.internal.atlassian.com/browse/SELENIUM</url>
    </ciManagement>

    <properties>
        <webdriver-browsers-version>3.2.2</webdriver-browsers-version>
        <browserstack-local-version>1.1.4</browserstack-local-version>
        <json>20231013</json>
        <!--    The vanilla version number is depended to be picked up by security scanners     -->
        <!--    https://bitbucket.org/atlassian/atlassian-selenium/pull-requests/103    -->
        <selenium.version>3.141.59-atlassian-1</selenium.version>
        <selenium.fork.version>${selenium.version}</selenium.fork.version>
        <mockito.version>2.28.2</mockito.version>
        <bytebuddy.version>1.14.19</bytebuddy.version>
        <junit.version>4.13.2</junit.version>
        <hamcrest.version>1.4-atlassian-1</hamcrest.version>
        <jetty.version>9.4.55.v20240627</jetty.version>
        <slf4j.version>1.7.36</slf4j.version>
        <!-- HTTP components are required by selenium but we explicitly exclude them such that selenium doesn't impose it as its transitive dependency -->
        <!-- This version below is used _for testing only_ and needs to be kept in sync with what selenium requires -->
        <!-- Client projects will have to provide their own version of HTTP components -->
        <httpclient.version>4.5.14</httpclient.version>
        <httpcore.version>4.4.16</httpcore.version>
        <atlassian.annotations.version>2.2.2</atlassian.annotations.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-api</artifactId>
                <version>${selenium.version}</version>
            </dependency>
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-java</artifactId>
                <version>${selenium.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.testng</groupId>
                        <artifactId>testng</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.apache.httpcomponents</groupId>
                        <artifactId>httpclient</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.apache.httpcomponents</groupId>
                        <artifactId>httpcore</artifactId>
                    </exclusion>
                    <!-- Selenium depends on an older version of byte-buddy and Mockito needs a newer one -->
                    <exclusion>
                        <groupId>net.bytebuddy</groupId>
                        <artifactId>byte-buddy</artifactId>
                    </exclusion>
                    <!--   Forked submodules   -->
                    <exclusion>
                        <groupId>org.seleniumhq.selenium</groupId>
                        <artifactId>selenium-firefox-driver</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <!--  Start of forked submodules
                  REMEMBER TO UPDATE THE SCANNABLE MODULE so our security scanners will notify us of upstream issues -->
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-firefox-driver</artifactId>
                <version>${selenium.fork.version}</version>
            </dependency>
            <!--  End of forked submodules    -->
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>3.16.0</version>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>32.1.3-jre</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.google.inject</groupId>
                <artifactId>guice</artifactId>
                <version>5.1.0</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
            </dependency>
            <dependency>
                <groupId>net.bytebuddy</groupId>
                <artifactId>byte-buddy</artifactId>
                <version>${bytebuddy.version}</version>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-core</artifactId>
                <version>${hamcrest.version}</version>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-library</artifactId>
                <version>${hamcrest.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.bundles</groupId>
                <artifactId>jsr305</artifactId>
                <version>1.1</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.annotations</groupId>
                <artifactId>atlassian-annotations</artifactId>
                <version>${atlassian.annotations.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <!-- Test Dependencies -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>${slf4j.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>${httpclient.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpcore</artifactId>
                <version>${httpcore.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>ban-conflicting-dependencies</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <phase>validate</phase>
                            <configuration>
                                <rules>
                                    <!--We only do guava from now on -->
                                    <bannedDependencies>
                                        <searchTransitive>true</searchTransitive>
                                        <message>
                                            Make sure google-collections is not accidentally included as transitive
                                            dependency. Use guava instead
                                        </message>
                                        <excludes>
                                            <exclude>com.google.collections:google-collections</exclude>
                                        </excludes>
                                    </bannedDependencies>
                                    <bannedDependencies>
                                        <searchTransitive>true</searchTransitive>
                                        <message>
                                            Make sure old versions of junit, hamcrest-all and mockito-all are
                                            not accidentally included as transitive dependency. Use junit 4.11+,
                                            hamcrest-core, hamcrest-library or mockito-core instead
                                        </message>
                                        <excludes>
                                            <exclude>junit:junit</exclude>
                                            <exclude>org.mockito:mockito-all</exclude>
                                            <exclude>org.hamcrest:hamcrest-all</exclude>
                                        </excludes>
                                        <includes>
                                            <!--Starting with 4.12 JUnit is a good boy -->
                                            <include>junit:junit:4.12</include>
                                        </includes>
                                    </bannedDependencies>

                                    <bannedDependencies>
                                        <searchTransitive>true</searchTransitive>
                                        <message>
                                            Make sure no junit-dep is on the classpath, we only accept junit:junit 4.11+
                                        </message>
                                        <excludes>
                                            <exclude>junit:junit-dep</exclude>
                                        </excludes>
                                    </bannedDependencies>
                                </rules>
                                <fail>true</fail>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <!-- Silence some m2e warnings in eclipse -->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-enforcer-plugin</artifactId>
                                        <versionRange>[1.0.0,)</versionRange>
                                        <goals>
                                            <goal>enforce</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <!-- The below custom-* profiles can be used to customize browser/profile versions without upgrading atlassian-browsees -->
        <!-- This should _only_ be used for testing that the upcoming atlassian-browsers release will be compatible -->
        <profile>
            <id>custom-chrome</id>
            <activation>
                <property>
                    <name>custom.chrome.version</name>
                </property>
            </activation>
            <dependencyManagement>
                <dependencies>
                    <dependency>
                        <groupId>com.atlassian.browsers</groupId>
                        <artifactId>chrome</artifactId>
                        <version>${custom.chrome.version}</version>
                        <classifier>osx</classifier>
                    </dependency>
                    <dependency>
                        <groupId>com.atlassian.browsers</groupId>
                        <artifactId>chrome-profile</artifactId>
                        <version>${custom.chrome.profile.version}</version>
                        <classifier>osx</classifier>
                    </dependency>
                    <dependency>
                        <groupId>com.atlassian.browsers</groupId>
                        <artifactId>chrome</artifactId>
                        <version>${custom.chrome.version}</version>
                        <classifier>linux</classifier>
                    </dependency>
                    <dependency>
                        <groupId>com.atlassian.browsers</groupId>
                        <artifactId>chrome-profile</artifactId>
                        <version>${custom.chrome.profile.version}</version>
                        <classifier>linux</classifier>
                    </dependency>
                    <dependency>
                        <groupId>com.atlassian.browsers</groupId>
                        <artifactId>chrome</artifactId>
                        <version>${custom.chrome.version}</version>
                        <classifier>linux64</classifier>
                    </dependency>
                    <dependency>
                        <groupId>com.atlassian.browsers</groupId>
                        <artifactId>chrome-profile</artifactId>
                        <version>${custom.chrome.profile.version}</version>
                        <classifier>linux64</classifier>
                    </dependency>
                </dependencies>
            </dependencyManagement>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>enforce-chrome-version-properties</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <phase>validate</phase>
                                <configuration>
                                    <rules>
                                        <requireProperty>
                                            <property>custom.chrome.version</property>
                                            <regex>.*\d.*</regex>
                                            <regexMessage>The custom.chrome.version property must contain at least one digit</regexMessage>
                                        </requireProperty>
                                        <requireProperty>
                                            <property>custom.chrome.profile.version</property>
                                            <message>You must set the custom.chrome.profile.version property alongside custom.chrome.version</message>
                                            <regex>.*\d.*</regex>
                                            <regexMessage>The custom.chrome.profile.version property must contain at least one digit</regexMessage>
                                        </requireProperty>
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>custom-firefox</id>
            <activation>
                <property>
                    <name>custom.firefox.version</name>
                </property>
            </activation>
            <dependencyManagement>
                <dependencies>
                    <dependency>
                        <groupId>com.atlassian.browsers</groupId>
                        <artifactId>firefox</artifactId>
                        <version>${custom.firefox.version}</version>
                        <classifier>osx</classifier>
                    </dependency>
                    <dependency>
                        <groupId>com.atlassian.browsers</groupId>
                        <artifactId>firefox</artifactId>
                        <version>${custom.firefox.version}</version>
                        <classifier>linux</classifier>
                    </dependency>
                    <dependency>
                        <groupId>com.atlassian.browsers</groupId>
                        <artifactId>firefox</artifactId>
                        <version>${custom.firefox.version}</version>
                        <classifier>linux64</classifier>
                    </dependency>
                    <dependency>
                        <groupId>com.atlassian.browsers</groupId>
                        <artifactId>firefox</artifactId>
                        <version>${custom.firefox.version}</version>
                        <classifier>windows</classifier>
                    </dependency>

                    <!-- Firefox profile is same for all OSes -->
                    <dependency>
                        <groupId>com.atlassian.browsers</groupId>
                        <artifactId>firefox-profile</artifactId>
                        <version>${custom.firefox.version}</version>
                    </dependency>
                </dependencies>
            </dependencyManagement>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>enforce-firefox-version-properties</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <phase>validate</phase>
                                <configuration>
                                    <rules>
                                        <requireProperty>
                                            <property>custom.firefox.version</property>
                                            <regex>.*\d.*</regex>
                                            <regexMessage>The custom.firefox.version property must contain at least one digit</regexMessage>
                                        </requireProperty>
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
