<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>

    <!-- NOTE(kklisura): Do not add parent tag here, since it gets deployed (via mvn deploy)[at least on snapshot repo],
         so clients won't be able to pull it unless parent is also deployed -->

    <groupId>ai.platon.cdt</groupId>
    <artifactId>cdt-kotlin-client</artifactId>
    <version>4.0.2</version>
    <packaging>jar</packaging>

    <name>cdt-kotlin-client</name>
    <description>Chrome DevTools Kotlin client</description>
    <url>https://github.com/galaxyeye/chrome-devtools-kotlin-client</url>

    <developers>
        <developer>
            <name>Vincent Zhang</name>
            <email>ivincent.zhang@gmail.com</email>
            <organization>browser4.io</organization>
            <timezone>+8</timezone>
        </developer>
    </developers>

    <organization>
        <name>browser4.io</name>
        <url>https://browser4.io</url>
    </organization>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git://github.com/galaxyeye/chrome-devtools-kotlin-client.git</connection>
        <developerConnection>scm:git:ssh://github.com/galaxyeye/chrome-devtools-kotlin-client.git</developerConnection>
        <url>https://github.com/galaxyeye/chrome-devtools-kotlin-client</url>
    </scm>

    <distributionManagement>
        <repository>
            <id>central</id>
            <url>https://central.sonatype.com/api/v1/publisher</url>
        </repository>
    </distributionManagement>

    <repositories>
        <repository>
            <id>Central</id>
            <url>https://repo1.maven.org/maven2/</url>
        </repository>
    </repositories>

    <!-- Required by dokka-maven-plugin -->
    <pluginRepositories>
        <pluginRepository>
            <id>jcenter</id>
            <name>JCenter</name>
            <url>https://jcenter.bintray.com/</url>
        </pluginRepository>
    </pluginRepositories>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.inceptionYear>2025</project.inceptionYear>

        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

        <kotlin.version>2.2.20</kotlin.version>
        <kotlin.coroutine.version>1.10.2</kotlin.coroutine.version>
        <kotlin.compiler.incremental>true</kotlin.compiler.incremental>

        <websocket.api.version>1.1</websocket.api.version>
        <ktor.version>2.3.13</ktor.version>

        <jackson.version>2.15.0</jackson.version>
        <javassist.version>3.24.1-GA</javassist.version>
        <slf4j.version>2.0.13</slf4j.version>

        <logback.version>1.5.13</logback.version>
        <junit.version>4.13.1</junit.version>
        <jacoco.version>0.8.12</jacoco.version>
        <easy.mock.version>3.4</easy.mock.version>
        <powermock.version>2.0.9</powermock.version>
        <jsonassert.version>1.5.0</jsonassert.version>
        <mockwebserver.version>2.7.5</mockwebserver.version>

        <dokka.version>1.9.10</dokka.version>
        <maven.surefire.plugin.version>3.2.5</maven.surefire.plugin.version>
        <maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
        <version.checksum-maven-plugin>1.11</version.checksum-maven-plugin>
        <checksum-maven-plugin.version>1.11</checksum-maven-plugin.version>
        <central-publishing-maven-plugin.version>0.9.0</central-publishing-maven-plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.jetbrains.kotlinx</groupId>
                <artifactId>kotlinx-coroutines-bom</artifactId>
                <version>${kotlin.coroutine.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-bom</artifactId>
                <version>${kotlin.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>

        <dependency>
            <groupId>ai.platon.pulsar</groupId>
            <artifactId>pulsar-common</artifactId>
            <version>3.0.14</version>
        </dependency>
        <dependency>
            <groupId>io.dropwizard.metrics</groupId>
            <artifactId>metrics-core</artifactId>
            <version>4.2.12</version>
        </dependency>

        <dependency>
            <groupId>javax.websocket</groupId>
            <artifactId>javax.websocket-api</artifactId>
            <version>${websocket.api.version}</version>
        </dependency>

        <dependency>
            <groupId>org.javassist</groupId>
            <artifactId>javassist</artifactId>
            <version>${javassist.version}</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
            <scope>test</scope>
        </dependency>

        <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-annotations</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.skyscreamer</groupId>
            <artifactId>jsonassert</artifactId>
            <version>${jsonassert.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.easymock</groupId>
            <artifactId>easymock</artifactId>
            <version>${easy.mock.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <version>${powermock.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-easymock</artifactId>
            <version>${powermock.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.squareup.okhttp</groupId>
            <artifactId>mockwebserver</artifactId>
            <version>${mockwebserver.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jacoco</groupId>
            <artifactId>org.jacoco.agent</artifactId>
            <classifier>runtime</classifier>
            <scope>test</scope>
            <version>${jacoco.version}</version>
        </dependency>







        <!-- Ktor client for coroutine-friendly WebSocket transport -->
        <dependency>
            <groupId>io.ktor</groupId>
            <artifactId>ktor-client-core</artifactId>
            <version>${ktor.version}</version>
        </dependency>
        <dependency>
            <groupId>io.ktor</groupId>
            <artifactId>ktor-client-core-jvm</artifactId>
            <version>${ktor.version}</version>
        </dependency>
        <dependency>
            <groupId>io.ktor</groupId>
            <artifactId>ktor-client-cio</artifactId>
            <version>${ktor.version}</version>
        </dependency>
        <dependency>
            <groupId>io.ktor</groupId>
            <artifactId>ktor-client-cio-jvm</artifactId>
            <version>${ktor.version}</version>
        </dependency>

        <dependency>
            <groupId>io.ktor</groupId>
            <artifactId>ktor-client-websockets</artifactId>
            <version>${ktor.version}</version>
        </dependency>

        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib-jdk8</artifactId>
            <version>${kotlin.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-test-junit</artifactId>
            <version>${kotlin.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>coverage</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${maven.surefire.plugin.version}</version>
                        <configuration>
                            <systemPropertyVariables>
                                <jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${jacoco.version}</version>
                        <executions>
                            <execution>
                                <id>default-instrument</id>
                                <goals>
                                    <goal>instrument</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>default-restore-instrumented-classes</id>
                                <goals>
                                    <goal>restore-instrumented-classes</goal>
                                </goals>
                                <phase>post-integration-test</phase>
                            </execution>
                            <execution>
                                <id>default-report</id>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.3.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                                <configuration>
                                    <includes>
                                        <include>src/main/java/**</include>
                                        <include>src/main/kotlin/**</include>
                                    </includes>
                                    <excludes>
                                        <exclude>target/**</exclude>
                                    </excludes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.6.3</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <doclint>none</doclint>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.1.0</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <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>
                        </configuration>
                    </plugin>

                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <resources>
            <resource>
                <includes>
                    <include>LICENSE.txt</include>
                    <include>THIRD-PARTY.txt</include>
                </includes>
                <directory>.</directory>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <!-- This plugin is also present in cdt-java-client, so be sure to copy any changes here to that module as well -->
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>2.0.0</version>
                <executions>
                    <execution>
                        <id>update-file-header</id>
                        <goals>
                            <goal>update-file-header</goal>
                        </goals>
                        <phase>process-sources</phase>
                    </execution>
                    <execution>
                        <id>attach-licenses</id>
                        <goals>
                            <goal>update-project-license</goal>
                            <goal>add-third-party</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <outputDirectory>${project.basedir}</outputDirectory>
                    <canUpdateCopyright>true</canUpdateCopyright>
                    <failOnMissing>true</failOnMissing>
                    <licenseName>apache_v2</licenseName>
                    <useMissingFile>true</useMissingFile>
                    <skipUpdateLicense>true</skipUpdateLicense>
                    <excludes>
                        <exclude>**/*.json</exclude>
                    </excludes>
                    <roots>
                        <root>src/main/java</root>
                        <root>src/test</root>
                    </roots>
                    <licenseMerges>
                        <licenseMerge>The Apache Software License, Version 2.0|Apache License, Version 2.0|Apache
                            Public License 2.0|Apache 2|Apache 2.0|Apache License 2.0|Apache License
                        </licenseMerge>
                        <licenseMerge>Eclipse Public License v1.0|Eclipse Public License 1.0|Eclipse Public License
                            - v 1.0
                        </licenseMerge>
                        <licenseMerge>BSD 3-Clause License|BSD|New BSD License</licenseMerge>
                        <licenseMerge>Dual license consisting of the CDDL v1.1 and GPL v2|CDDL+GPL</licenseMerge>
                    </licenseMerges>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.coveo</groupId>
                <artifactId>fmt-maven-plugin</artifactId>
                <version>2.9.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>format</goal>
                        </goals>
                        <phase>process-sources</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.plugin.version}</version>
                <configuration>
                    <argLine>${jacoco.agent.argLine} --add-opens java.base/java.lang=ALL-UNNAMED --add-opens
                        java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED
                        --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.regex=ALL-UNNAMED
                        --add-opens java.base/java.nio.file=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED
                        --add-opens java.base/java.util.concurrent=ALL-UNNAMED --add-opens
                        java.base/sun.nio.fs=ALL-UNNAMED
                    </argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
                <executions>
                    <execution>
                        <id>pre-unit-test</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <propertyName>jacoco.agent.argLine</propertyName>
                        </configuration>
                    </execution>
                    <execution>
                        <id>post-unit-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <version>${kotlin.version}</version>
                <executions>
                    <execution>
                        <id>compile</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <sourceDirs>
                                <source>src/main/kotlin</source>
                            </sourceDirs>
                        </configuration>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <jvmTarget>${maven.compiler.target}</jvmTarget>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.jetbrains.dokka</groupId>
                <artifactId>dokka-maven-plugin</artifactId>
                <version>${dokka.version}</version>
                <executions>
                    <execution>
                        <!-- generate javadoc.jar before package gpg plugin can generate asc for it -->
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>dokka</goal>
                            <goal>javadocJar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!-- Set to true to skip dokka task, default: false -->
                    <skip>false</skip>

                    <!-- Use default or set to custom path to cache directory to enable package-list caching. -->
                    <!-- When set to default, caches stored in $USER_HOME/.cache/dokka -->
                    <cacheRoot>default</cacheRoot>

                    <!-- Used for linking to JDK, default: 11 -->
                    <jdkVersion>11</jdkVersion>

                    <!-- Do not output deprecated members, applies globally, can be overridden by packageOptions -->
                    <skipDeprecated>true</skipDeprecated>
                    <!-- Emit warnings about not documented members, applies globally, also can be overridden by packageOptions -->
                    <reportUndocumented>true</reportUndocumented>
                    <!-- Do not create index pages for empty packages -->
                    <skipEmptyPackages>false</skipEmptyPackages>
                    <includeNonPublic>false</includeNonPublic>

                    <!-- Short form list of sourceRoots, by default, set to ${project.compileSourceRoots} -->
                    <sourceDirectories>
                        <dir>${project.basedir}/src/main/java</dir>
                        <dir>${project.basedir}/src/main/kotlin</dir>
                    </sourceDirectories>

                    <!-- Disable linking to online kotlin-stdlib documentation  -->
                    <noStdlibLink>false</noStdlibLink>
                    <noJdkLink>false</noJdkLink>

                    <!-- Allows to customize documentation generation options on a per-package basis -->
                    <perPackageOptions>
                        <packageOptions>
                            <!-- Will match kotlin and all sub-packages of it -->
                            <!-- <prefix>kotlin</prefix>-->

                            <!-- All options are optional, default values are below: -->
                            <skipDeprecated>false</skipDeprecated>
                            <!-- Emit warnings about not documented members  -->
                            <reportUndocumented>true</reportUndocumented>
                            <includeNonPublic>false</includeNonPublic>
                        </packageOptions>
                    </perPackageOptions>
                </configuration>
            </plugin>

            <!--                    &lt;!&ndash; Generate Kotlin documentation &ndash;&gt;-->
            <!--                    <plugin>-->
            <!--                        <groupId>org.jetbrains.dokka</groupId>-->
            <!--                        <artifactId>dokka-maven-plugin</artifactId>-->
            <!--                        <version>${dokka.version}</version>-->
            <!--                        <executions>-->
            <!--                            <execution>-->
            <!--                                <phase>prepare-package</phase>-->
            <!--                                <goals>-->
            <!--                                    <goal>javadocJar</goal>-->
            <!--                                </goals>-->
            <!--                            </execution>-->
            <!--                        </executions>-->
            <!--                        <configuration>-->
            <!--                            <sourceDirectories>-->
            <!--                                <dir>${project.basedir}/src/main/kotlin</dir>-->
            <!--                                <dir>${project.basedir}/src/main/java</dir>-->
            <!--                            </sourceDirectories>-->
            <!--                            <documentedVisibilities>-->
            <!--                                <visibility>PUBLIC</visibility>-->
            <!--                                <visibility>PROTECTED</visibility>-->
            <!--                            </documentedVisibilities>-->
            <!--                            <skipEmptyPackages>true</skipEmptyPackages>-->
            <!--                            <reportUndocumented>false</reportUndocumented>-->
            <!--                            <platform>jvm</platform>-->
            <!--                            <jdkVersion>11</jdkVersion>-->
            <!--                        </configuration>-->
            <!--                    </plugin>-->

            <!-- GPG signing -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>${maven-gpg-plugin.version}</version>
                <configuration>
                    <gpgArguments>
                        <arg>--pinentry-mode</arg>
                        <arg>loopback</arg>
                    </gpgArguments>
                </configuration>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Calculate checksums -->
            <plugin>
                <groupId>net.nicoulaj.maven.plugins</groupId>
                <artifactId>checksum-maven-plugin</artifactId>
                <version>${checksum-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>source-release-checksum</id>
                        <goals>
                            <goal>files</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <algorithms>
                        <algorithm>SHA-512</algorithm>
                        <algorithm>SHA-256</algorithm>
                    </algorithms>
                    <csvSummary>false</csvSummary>
                    <fileSets>
                        <fileSet>
                            <directory>${project.build.directory}</directory>
                            <includes>
                                <include>${project.artifactId}-${project.version}-sources.jar</include>
                                <include>${project.artifactId}-${project.version}-javadoc.jar</include>
                                <include>${project.artifactId}-${project.version}.jar</include>
                            </includes>
                        </fileSet>
                    </fileSets>
                    <failIfNoFiles>false</failIfNoFiles>
                </configuration>
            </plugin>

        </plugins>
    </build>
</project>
