<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>io.github.bonigarcia</groupId>
    <artifactId>webdrivermanager</artifactId>
    <version>6.3.3</version>

    <properties>
        <!-- compile -->
        <slf4j.version>2.0.17</slf4j.version>
        <gson.version>2.13.2</gson.version>
        <docker-java.version>3.6.0</docker-java.version>
        <brotli.version>0.1.2</brotli.version>
        <commons-lang3.version>3.19.0</commons-lang3.version>
        <commons-compress.version>1.28.0</commons-compress.version>
        <httpclient5.version>5.4.3</httpclient5.version>

        <!-- provided -->
        <selenium.version>4.38.0</selenium.version>
        <javalin.version>4.6.8</javalin.version>

        <!-- test -->
        <logback.version>1.5.18</logback.version>
        <junit.version>6.0.1</junit.version>
        <assertj.version>3.27.6</assertj.version>
        <mockserver.version>5.15.0</mockserver.version>
        <mockito-junit-jupiter.version>5.20.0</mockito-junit-jupiter.version>

        <!-- plugins -->
        <maven-release-plugin.version>3.1.1</maven-release-plugin.version>
        <maven-surefire-plugin.version>3.5.4</maven-surefire-plugin.version>
        <jacoco-maven-plugin.version>0.8.14</jacoco-maven-plugin.version>
        <maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
        <exec-maven-plugin.version>3.6.2</exec-maven-plugin.version>
        <maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
        <maven-asciidoctor-plugin.version>3.2.0</maven-asciidoctor-plugin.version>
        <asciidoctorj-pdf.version>2.3.23</asciidoctorj-pdf.version>
        <maven-site.version>3.21.0</maven-site.version>
        <maven-project-info-reports.version>3.9.0</maven-project-info-reports.version>
        <maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>
        <maven-compiler-plugin.version>3.14.1</maven-compiler-plugin.version>
        <central-publishing-maven-plugin.version>0.9.0</central-publishing-maven-plugin.version>
        <maven-source-plugin.version>3.3.1</maven-source-plugin.version>
        <maven-jxr-plugin.version>3.6.0</maven-jxr-plugin.version>

        <!-- Java version -->
        <java.version>8</java.version>
        <java-test.version>17</java-test.version>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <maven.compiler.source>${java.version}</maven.compiler.source>

        <!-- encoding -->
        <project.encondig>UTF-8</project.encondig>
        <project.build.sourceEncoding>${project.encondig}</project.build.sourceEncoding>
        <project.reporting.outputEncoding>${project.encondig}</project.reporting.outputEncoding>

        <!-- format date -->
        <maven.build.timestamp.format>dd-MM-yyyy</maven.build.timestamp.format>

        <!-- custom -->
        <wdm.mainClass>io.github.bonigarcia.wdm.WebDriverManager</wdm.mainClass>
        <wdm.agentClass>io.github.bonigarcia.wdm.WdmAgent</wdm.agentClass>
        <wdm.manifest>src/main/resources/META-INF/MANIFEST.MF</wdm.manifest>

        <!-- doc version -->
        <doc.version>${project.version}</doc.version>
    </properties>

    <name>WebDriverManager</name>
    <description>
        Automated driver management and other helper features for Selenium
        WebDriver in Java
    </description>
    <url>https://bonigarcia.dev/webdrivermanager/</url>

    <developers>
        <developer>
            <id>bonigarcia</id>
            <name>Boni Garcia</name>
            <url>https://bonigarcia.dev/</url>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>Apache 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:https://github.com/bonigarcia/webdrivermanager.git</connection>
        <developerConnection>
            scm:git:https://github.com/bonigarcia/webdrivermanager.git</developerConnection>
        <url>https://github.com/bonigarcia/webdrivermanager</url>
        <tag>webdrivermanager-6.3.3</tag>
    </scm>

    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.github.docker-java</groupId>
            <artifactId>docker-java</artifactId>
            <version>${docker-java.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>com.github.docker-java</groupId>
                    <artifactId>docker-java-transport-jersey</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.github.docker-java</groupId>
                    <artifactId>docker-java-transport-netty</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.bouncycastle</groupId>
                    <artifactId>bcpkix-jdk18on</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.github.docker-java</groupId>
            <artifactId>docker-java-transport-httpclient5</artifactId>
            <version>${docker-java.version}</version>
        </dependency>
        <dependency>
            <groupId>org.brotli</groupId>
            <artifactId>dec</artifactId>
            <version>${brotli.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-compress</artifactId>
            <version>${commons-compress.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents.client5</groupId>
            <artifactId>httpclient5</artifactId>
            <version>${httpclient5.version}</version>
        </dependency>

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>${selenium.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.javalin</groupId>
            <artifactId>javalin</artifactId>
            <version>${javalin.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mock-server</groupId>
            <artifactId>mockserver-junit-jupiter</artifactId>
            <version>${mockserver.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-grid</artifactId>
            <version>${selenium.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>${mockito-junit-jupiter.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <executions>
                    <execution>
                        <id>default-compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <source>${java.version}</source>
                            <target>${java.version}</target>
                        </configuration>
                    </execution>
                    <execution>
                        <id>default-testCompile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                        <configuration>
                            <source>${java-test.version}</source>
                            <target>${java-test.version}</target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven-release-plugin.version}</version>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <excludes>
                        <exclude>**com.gargoylesoftware*</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>${exec-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>java</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <mainClass>${wdm.mainClass}</mainClass>
                    <includePluginDependencies>false</includePluginDependencies>
                    <cleanupDaemonThreads>false</cleanupDaemonThreads>
                    <classpathScope>test</classpathScope>
                    <systemProperties>
                        <systemProperty>
                            <key>logback.configurationFile</key>
                            <value>src/main/resources/logback.xml</value>
                        </systemProperty>
                    </systemProperties>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>${wdm.mainClass}</mainClass>
                        </manifest>
                        <manifestEntries>
                            <Premain-Class>${wdm.agentClass}</Premain-Class>
                            <Can-Redefine-Classes>true</Can-Redefine-Classes>
                            <Can-Retransform-Classes>true</Can-Retransform-Classes>
                        </manifestEntries>
                    </archive>
                    <descriptors>
                        <descriptor>src/main/resources/assembly.xml</descriptor>
                    </descriptors>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven-jar-plugin.version}</version>
                <configuration>
                    <excludes>
                        <exclude>**/*.xml</exclude>
                    </excludes>
                    <archive>
                        <manifestFile>${wdm.manifest}</manifestFile>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.asciidoctor</groupId>
                <artifactId>asciidoctor-maven-plugin</artifactId>
                <version>${maven-asciidoctor-plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.asciidoctor</groupId>
                        <artifactId>asciidoctorj-pdf</artifactId>
                        <version>${asciidoctorj-pdf.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <sourceDirectory>src/doc/asciidoc</sourceDirectory>
                    <attributes>
                        <endpoint-url>https://bonigarcia.dev</endpoint-url>
                        <sourcedir>${project.build.sourceDirectory}</sourcedir>
                        <project-version>${doc.version}</project-version>
                    </attributes>
                    <outputDirectory>${basedir}/docs</outputDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>asciidoc-to-html</id>
                        <phase>pre-site</phase>
                        <goals>
                            <goal>process-asciidoc</goal>
                        </goals>
                        <configuration>
                            <backend>html5</backend>
                            <attributes>
                                <source-highlighter>coderay</source-highlighter>
                                <stylesheet>css/styles.css</stylesheet>
                                <imagesdir>img</imagesdir>
                                <toc>left</toc>
                                <icons>font</icons>
                                <sectanchors>true</sectanchors>
                                <idprefix />
                                <idseparator>-</idseparator>
                                <docinfo1>true</docinfo1>
                                <toclevels>3</toclevels>
                                <sectnums />
                                <lang>en</lang>
                                <docdatetime>${maven.build.timestamp}</docdatetime>
                                <last-update-label>Updated on</last-update-label>
                            </attributes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>asciidoc-to-pdf</id>
                        <phase>site</phase>
                        <goals>
                            <goal>process-asciidoc</goal>
                        </goals>
                        <configuration>
                            <doctype>book</doctype>
                            <backend>pdf</backend>
                            <sourceDirectory>src/doc/asciidoc</sourceDirectory>
                            <sourceDocumentName>index.adoc</sourceDocumentName>
                            <outputFile>${project.artifactId}.pdf</outputFile>
                            <attributes>
                                <source-highlighter>coderay</source-highlighter>
                                <imagesdir>img</imagesdir>
                                <pagenums />
                                <toc />
                                <idprefix />
                                <idseparator>-</idseparator>
                                <icons>font</icons>
                                <sectnums />
                                <lang>en</lang>
                                <revnumber>${doc.version}</revnumber>
                                <revdate>${maven.build.timestamp}</revdate>
                            </attributes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>${maven-site.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>${maven-project-info-reports.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <additionalOptions>-Xdoclint:none</additionalOptions>
                    <source>${java.version}</source>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>${maven-jxr-plugin.version}</version>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <snapshotRepository>
            <id>central</id>
            <url>https://central.sonatype.com/repository/maven-snapshots/</url>
        </snapshotRepository>
        <repository>
            <id>central</id>
            <url>https://central.sonatype.com</url>
        </repository>
    </distributionManagement>

    <repositories>
        <repository>
            <id>central-portal-snapshots</id>
            <name>Central Portal Snapshots</name>
            <url>https://central.sonatype.com/repository/maven-snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <additionalOptions>-Xdoclint:none</additionalOptions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>${maven-jxr-plugin.version}</version>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>${central-publishing-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                            <waitUntil>published</waitUntil>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven-javadoc-plugin.version}</version>
                        <configuration>
                            <additionalOptions>-Xdoclint:none</additionalOptions>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>