<?xml version="1.0" encoding="UTF-8"?>
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
	license agreements. See the NOTICE file distributed with this work for additional
	information regarding copyright ownership. The ASF licenses this file to
	you under the Apache License, Version 2.0 (the "License"); you may not use
	this file except in compliance with the License. You may obtain a copy of
	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
	by applicable law or agreed to in writing, software distributed under the
	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
	OF ANY KIND, either express or implied. See the License for the specific
	language governing permissions and limitations under the License. -->
<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>ai.platon</groupId>
        <artifactId>pulsar-parent</artifactId>
        <!-- Parent POM should always use the published version -->
        <version>4.5.0</version>
    </parent>

    <groupId>ai.platon.pulsar</groupId>
    <artifactId>pulsar</artifactId>
    <version>4.9.2</version>
    <packaging>pom</packaging>

    <name>Browser4 Base</name>
    <description>A lightning-fast, coroutine-safe browser for your AI.</description>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Vincent Zhang</name>
            <email>ivincent.zhang@gmail.com</email>
            <organization>platon.ai</organization>
            <timezone>+8</timezone>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/platonai/Browser4-base.git</connection>
        <developerConnection>scm:git:https://github.com/platonai/Browser4-base.git</developerConnection>
        <url>https://github.com/platonai/Browser4-base</url>
        <tag>HEAD</tag>
    </scm>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/platonai/Browser4-base/issues</url>
    </issueManagement>

    <ciManagement>
        <system>GitHub Actions</system>
        <url>https://github.com/platonai/Browser4-base/actions</url>
    </ciManagement>

    <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>

    <!-- Default active modules. The main goal is to allow the user to run PulsarApplication
     with a single click in the IDE right after opening the project. -->
    <modules>
        <module>pulsar-dependencies</module>
        <module>pulsar-core</module>
        <module>pulsar-bom</module>
        <module>pulsar-spring-support</module>
        <module>pulsar-tests/pulsar-tests-common</module>
        <module>pulsar-all</module>
    </modules>

    <profiles>

        <!-- Test execution profiles based on test-strategy.md -->
        <profile>
            <id>tests-integration</id>
            <activation>
                <property>
                    <name>runITs</name>
                    <value>true</value>
                </property>
            </activation>
            <properties>
                <!-- Integration tests can be Slow/Heavy - this is expected behavior
                     Integration tests CAN require Browser/AI/Docker for service collaboration
                     Only exclude E2E, SDK, and ManualOnly tests -->
                <surefire.excludedGroups>E2E,E2ETest,ManualOnly</surefire.excludedGroups>
            </properties>
            <modules>
                <module>pulsar-tests/pulsar-it-tests</module>
            </modules>
        </profile>

        <!-- Test execution profiles based on test-strategy.md -->
        <profile>
            <id>tests-e2e</id>
            <activation>
                <property>
                    <name>runE2Es</name>
                    <value>true</value>
                </property>
            </activation>
            <properties>
                <!-- Integration tests can be Slow/Heavy - this is expected behavior
                     Integration tests CAN require Browser/AI/Docker for service collaboration
                     Only exclude E2E, SDK, and ManualOnly tests -->
                <surefire.excludedGroups>ManualOnly</surefire.excludedGroups>
            </properties>
            <modules>
                <module>pulsar-tests/pulsar-e2e-tests</module>
            </modules>
        </profile>

        <!-- Deployment profile -->
        <profile>
            <id>deploy</id>

            <build>
                <plugins>
                    <!-- Attach sources -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Help maven-source-plugin works with kotlin -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <version>3.6.0</version>

                        <executions>
                            <execution>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>add-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>src/main/kotlin</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Override parent pom's javadoc settings, skip generating javadoc, use kdoc instead -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <skip>true</skip>
                        </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 a dokka task, default: false -->
                            <skip>false</skip>

                            <!-- Use default or set to a 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>${javaVersion}</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>true</skipEmptyPackages>
                            <includeNonPublic>false</includeNonPublic>


                            <!-- 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>
                            <sourceDirectories>
                                <dir>${project.basedir}/src/main/kotlin</dir>
                            </sourceDirectories>
                        </configuration>
                    </plugin>

                    <!-- GPG signing -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <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>${version.checksum-maven-plugin}</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>

                    <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>
                            <!-- Just for validated to avoid waiting for too long time -->
                            <waitUntil>validated</waitUntil>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <defaultGoal>install</defaultGoal>

        <plugins>
            <!--  kotlin plugin should come before maven-compiler-plugin  -->

            <!--  kotlin  -->
            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <version>${kotlin.version}</version>
                <!-- You can set this option to automatically take information about lifecycles -->
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>compile</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <sourceDirs>
                                <sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
                            </sourceDirs>
                        </configuration>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                        <configuration>
                            <sourceDirs>
                                <sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
                            </sourceDirs>
                        </configuration>
                    </execution>
                </executions>
                <!--  Required by spring  -->
                <dependencies>
                    <dependency>
                        <groupId>org.jetbrains.kotlin</groupId>
                        <artifactId>kotlin-maven-allopen</artifactId>
                        <version>${kotlin.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.jetbrains.kotlin</groupId>
                        <artifactId>kotlin-maven-noarg</artifactId>
                        <version>${kotlin.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <args>
                        <arg>-Xjsr305=strict</arg>
                    </args>
                    <compilerPlugins>
                        <plugin>spring</plugin>
                        <plugin>jpa</plugin>
                        <plugin>all-open</plugin>
                    </compilerPlugins>
                    <pluginOptions>
                        <option>all-open:annotation=javax.persistence.Entity</option>
                        <option>all-open:annotation=javax.persistence.Embeddable</option>
                        <option>all-open:annotation=javax.persistence.MappedSuperclass</option>
                    </pluginOptions>
                    <jvmTarget>${kotlin.compiler.jvmTarget}</jvmTarget>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
            </plugin>

            <!--
            The Surefire Plugin is used during the test phase of the build lifecycle to execute the unit tests of
            an application.
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${version.maven-surefire}</version>
                <configuration>
                    <!--

                    -->
                    <excludedGroups>${surefire.excludedGroups}</excludedGroups>

                    <!-- All tests are in the same JVM process -->
                    <forkCount>1</forkCount>
                    <reuseForks>true</reuseForks>
                    <!-- Enable byte-buddy-agent -->
                    <argLine>-XX:+EnableDynamicAgentLoading</argLine>
                    <useModulePath>false</useModulePath>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-bom</artifactId>
                <version>${kotlin.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>ai.platon</groupId>
                <artifactId>pulsar-dependencies</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- Internal Dependencies -->
            <dependency>
                <groupId>ai.platon.pulsar</groupId>
                <artifactId>pulsar-common</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>ai.platon.pulsar</groupId>
                <artifactId>pulsar-plugins</artifactId>
                <type>pom</type>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>ai.platon.pulsar</groupId>
                <artifactId>pulsar-persist</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>ai.platon.pulsar</groupId>
                <artifactId>pulsar-skeleton</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>ai.platon.pulsar</groupId>
                <artifactId>pulsar-resources</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>ai.platon.pulsar</groupId>
                <artifactId>pulsar-resources</artifactId>
                <type>test-jar</type>
                <classifier>tests</classifier>
                <scope>test</scope>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>ai.platon.pulsar</groupId>
                <artifactId>pulsar-protocol</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>ai.platon.pulsar</groupId>
                <artifactId>pulsar-parse</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>ai.platon.pulsar</groupId>
                <artifactId>pulsar-browser</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>ai.platon.pulsar</groupId>
                <artifactId>pulsar-llm</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>ai.platon.pulsar</groupId>
                <artifactId>pulsar-dom</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>ai.platon.pulsar</groupId>
                <artifactId>pulsar-ql-common</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>ai.platon.pulsar</groupId>
                <artifactId>pulsar-ql-common</artifactId>
                <classifier>shaded</classifier>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>ai.platon.pulsar</groupId>
                <artifactId>pulsar-ql</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>ai.platon.pulsar</groupId>
                <artifactId>pulsar-boot</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>ai.platon.pulsar</groupId>
                <artifactId>pulsar-tests-common</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>ai.platon.pulsar</groupId>
                <artifactId>pulsar-tests-common</artifactId>
                <classifier>tests</classifier>
                <scope>test</scope>
                <version>${project.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-reflect</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlinx</groupId>
            <artifactId>kotlinx-coroutines-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-test-junit5</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <properties>
        <!-- Suppress warning: [WARNING] Using platform encoding (GBK actually) to copy filtered resources -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <dokka.version>1.9.10</dokka.version>

        <surefire.version>3.5.4</surefire.version>

        <jacoco-maven-plugin.version>0.8.11</jacoco-maven-plugin.version>
        <central-publishing-maven-plugin.version>0.10.0</central-publishing-maven-plugin.version>

        <version.apache-rat-plugin>0.16.1</version.apache-rat-plugin>
        <version.apache-resource-bundles>1.7</version.apache-resource-bundles>
        <version.checksum-maven-plugin>1.11</version.checksum-maven-plugin>
        <version.maven-antrun-plugin>3.2.0</version.maven-antrun-plugin>
        <version.maven-assembly-plugin>3.8.0</version.maven-assembly-plugin>
        <version.maven-clean-plugin>3.5.0</version.maven-clean-plugin>
        <version.maven-checkstyle-plugin>3.6.0</version.maven-checkstyle-plugin>
        <version.maven-compiler-plugin>3.14.1</version.maven-compiler-plugin>
        <version.maven-dependency-plugin>3.9.0</version.maven-dependency-plugin>
        <version.maven-deploy-plugin>3.1.4</version.maven-deploy-plugin>
        <version.maven-ear-plugin>3.4.0</version.maven-ear-plugin>
        <version.maven-enforcer-plugin>3.6.2</version.maven-enforcer-plugin>
        <version.maven-fluido-skin>2.1.0</version.maven-fluido-skin>
        <version.maven-gpg-plugin>3.2.8</version.maven-gpg-plugin>
        <version.maven-help-plugin>3.5.1</version.maven-help-plugin>
        <version.maven-install-plugin>3.1.4</version.maven-install-plugin>
        <version.maven-invoker-plugin>3.9.1</version.maven-invoker-plugin>
        <version.maven-jar-plugin>3.5.0</version.maven-jar-plugin>
        <version.maven-javadoc-plugin>3.12.0</version.maven-javadoc-plugin>
        <version.maven-plugin-tools>3.15.2</version.maven-plugin-tools>
        <version.maven-project-info-reports-plugin>3.9.0</version.maven-project-info-reports-plugin>
        <version.maven-release-plugin>3.3.1</version.maven-release-plugin>
        <version.maven-remote-resources-plugin>3.3.0</version.maven-remote-resources-plugin>
        <version.maven-resources-plugin>3.4.0</version.maven-resources-plugin>
        <version.maven-scm-plugin>2.2.1</version.maven-scm-plugin>
        <version.maven-scm-publish-plugin>3.3.0</version.maven-scm-publish-plugin>
        <version.maven-shade-plugin>3.6.1</version.maven-shade-plugin>
        <version.maven-site-plugin>3.21.0</version.maven-site-plugin>
        <version.maven-source-plugin>3.4.0</version.maven-source-plugin>
        <version.maven-surefire>${surefire.version}</version.maven-surefire>
        <version.maven-war-plugin>3.5.1</version.maven-war-plugin>

        <!--  Language  -->
        <javaVersion>17</javaVersion>
        <kotlinVersion>2.2.21</kotlinVersion>
        <kotlin.coroutine.version>1.10.2</kotlin.coroutine.version>

        <!--  Kotlin  -->
        <kotlin.version>${kotlinVersion}</kotlin.version>
        <maven.compiler.release>${javaVersion}</maven.compiler.release>
        <kotlin.compiler.jvmTarget>${javaVersion}</kotlin.compiler.jvmTarget>

        <!-- Test execution control properties -->
        <runITs>false</runITs>

        <!-- Default excludedGroups: exclude all non-Fast tests
             Includes both new taxonomy tags and legacy tags for backward compatibility:
             - New tags: Slow, Heavy, Integration, E2E, SDK, RequiresXYZ, ManualOnly
             - Legacy tags: IntegrationTest, E2ETest, HeavyTest, SkippableLowerLevelTest, TestInfraCheck, OptionalTest
             Migration: Gradually migrate tests from legacy tags to new taxonomy -->
        <surefire.excludedGroups>
            Slow,Heavy,RequiresServer,RequiresBrowser,RequiresAI,RequiresDocker,
            E2E,SDK,ManualOnly,
            SkippableLowerLevelTest,TestInfraCheck,OptionalTest,
            IntegrationTest,E2ETest,HeavyTest
        </surefire.excludedGroups>
    </properties>

</project>













