<?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>7.0.15</version>
    </parent>

    <groupId>com.atlassian.selenium</groupId>
    <artifactId>atlassian-selenium-parent</artifactId>
    <version>4.7.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-visual-comparison</module>
        <module>atlassian-webdriver</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-4.7.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>
        <atl-browsers-version>4.3.0</atl-browsers-version>

        <selenium.version>4.40.0</selenium.version>

        <atl-annotations.version>4.0.3</atl-annotations.version>
        <atl-util-concurrent.version>4.2.1</atl-util-concurrent.version>
        <velocity.version>1.6.4-atlassian-40</velocity.version>

        <bytebuddy.version>1.18.5</bytebuddy.version>
        <commons-lang3.version>3.20.0</commons-lang3.version>
        <commons-collections.version>3.2.2</commons-collections.version>
        <guava.version>32.1.3-jre</guava.version>
        <guice.version>6.0.0</guice.version>
        <hamcrest.version>3.0</hamcrest.version>
        <jetty.version>9.4.58.v20250814</jetty.version>
        <json>20231013</json>
        <jsr305.version>1.1</jsr305.version>
        <junit.version>4.13.2</junit.version>
        <mockito.version>4.11.0</mockito.version>
        <slf4j.version>2.0.17</slf4j.version>
        <system-rules.version>1.19.0</system-rules.version>
        <netty.version>4.2.10.Final</netty.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- Project modules  -->
            <dependency>
                <groupId>com.atlassian.selenium</groupId>
                <artifactId>atlassian-pageobjects-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.selenium</groupId>
                <artifactId>atlassian-pageobjects-elements</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.selenium</groupId>
                <artifactId>atlassian-pageobjects-elements-aui</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.selenium</groupId>
                <artifactId>atlassian-visual-comparison</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.selenium</groupId>
                <artifactId>atlassian-webdriver</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.selenium</groupId>
                <artifactId>atlassian-webdriver-core</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- Production dependencies -->

            <!-- Dependencies Atl-Selenium sets the version of -->
            <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.seleniumhq.selenium</groupId>
                        <artifactId>selenium-ie-driver</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-firefox-driver</artifactId>
                <version>${selenium.version}</version>
            </dependency>

            <!-- Dependencies Atl-Selenium doesn't care too much about the version -->

            <!-- First party -->
            <dependency>
                <groupId>com.atlassian.annotations</groupId>
                <artifactId>atlassian-annotations</artifactId>
                <version>${atl-annotations.version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.browsers</groupId>
                <artifactId>atlassian-browsers-auto</artifactId>
                <version>${atl-browsers-version}</version>
            </dependency>
            <dependency>
                <groupId>com.atlassian.bundles</groupId>
                <artifactId>jsr305</artifactId>
                <version>${jsr305.version}</version>
            </dependency>
            <dependency>
                <groupId>io.atlassian.util.concurrent</groupId>
                <artifactId>atlassian-util-concurrent</artifactId>
                <version>${atl-util-concurrent.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.velocity</groupId>
                <artifactId>velocity</artifactId>
                <version>${velocity.version}</version>
            </dependency>

            <!-- Third party -->
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.inject</groupId>
                <artifactId>guice</artifactId>
                <version>${guice.version}</version>
            </dependency>
            <!--    SPFE-229: Required to bump the version stemming from velocity    -->
            <dependency>
                <groupId>commons-collections</groupId>
                <artifactId>commons-collections</artifactId>
                <version>${commons-collections.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons-lang3.version}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-server</artifactId>
                <version>${jetty.version}</version>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest</artifactId>
                <version>${hamcrest.version}</version>
            </dependency>
            <dependency>
                <groupId>org.json</groupId>
                <artifactId>json</artifactId>
                <version>${json}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.hamcrest</groupId>
                        <artifactId>hamcrest-core</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>net.bytebuddy</groupId>
                <artifactId>byte-buddy</artifactId>
                <version>${bytebuddy.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <dependency>
                <groupId>com.github.stefanbirkner</groupId>
                <artifactId>system-rules</artifactId>
                <version>${system-rules.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <!-- netty dependencies added explicitly as selenium-firefox-driver version desired bump to 4.14.1 no longer supports netty and results in compile failure-->
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-common</artifactId>
                <version>${netty.version}</version>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-codec-http</artifactId>
                <version>${netty.version}</version>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-codec</artifactId>
                <version>${netty.version}</version>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-handler</artifactId>
                <version>${netty.version}</version>
            </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 or mockito-core instead
                                        </message>
                                        <excludes>
                                            <exclude>junit:junit</exclude>
                                            <exclude>org.mockito:mockito-all</exclude>
                                            <exclude>org.mockito:mockito-inline</exclude>
                                            <exclude>org.hamcrest:hamcrest-all</exclude>
                                            <exclude>org.hamcrest:hamcrest-library</exclude>
                                            <exclude>org.hamcrest:hamcrest-core</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>
