<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright © 2021-present Arcade Data Ltd (info@arcadedata.com)

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

    SPDX-FileCopyrightText: 2021-present Arcade Data Ltd (info@arcadedata.com)
    SPDX-License-Identifier: Apache-2.0
-->
<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>com.arcadedb</groupId>
    <artifactId>arcadedb-parent</artifactId>
    <packaging>pom</packaging>
    <version>26.9.1</version>

    <name>ArcadeDB</name>
    <url>https://arcadedata.com/</url>
    <description>ArcadeDB</description>

    <inceptionYear>2021</inceptionYear>

    <organization>
        <name>Arcade Data Ltd</name>
        <url>https://arcadedata.com/</url>
    </organization>

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

    <properties>
        <maven-compiler-plugin.release>21</maven-compiler-plugin.release>
        <exclude.tests></exclude.tests>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <skipITs>true</skipITs>
        <skipTests>false</skipTests>

        <!-- Default surefire tag exclusion (issue #5697): keep this as a property, not a literal
             <excludedGroups> in the surefire <configuration> below. A literal there would win over
             the same-named -D user property on the command line (plugin configuration beats -D),
             silently defeating every CI lane that passes its own -DexcludedGroups=... or that relies
             on -Dgroups=benchmark alone selecting benchmark-tagged tests. Keeping it a property lets
             -DexcludedGroups=... on the command line override this default as expected. -->
        <excludedGroups>benchmark</excludedGroups>
        <!-- maven-failsafe-plugin's own excludedGroups parameter defaults to this SAME ${excludedGroups}
             user property (confirmed via its plugin.xml), so without a parameter of its own it would
             silently inherit the surefire-only "benchmark" default above and drop @Tag("benchmark")
             integration tests (e.g. Issue5413DenseVectorServerLatencyIT) from every -Pintegration lane.
             Give failsafe its own namespaced property, left empty by default, so ITs are unaffected. -->
        <failsafe.excludedGroups></failsafe.excludedGroups>

        <itCoverageAgent></itCoverageAgent>
        <argLine></argLine>

        <docker.plugin.version>1.2.2</docker.plugin.version>
        <maven-compiler-plugin.version>3.15.0</maven-compiler-plugin.version>
        <jacoco-maven-plugin.version>0.8.15</jacoco-maven-plugin.version>
        <maven-surefire-plugin.version>3.5.6</maven-surefire-plugin.version>
        <maven-failsafe-plugin.version>3.5.6</maven-failsafe-plugin.version>
        <maven-assembly-plugin.version>3.8.0</maven-assembly-plugin.version>
        <maven-resources-plugin.version>3.5.0</maven-resources-plugin.version>
        <maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>
        <maven-source-plugin.version>3.4.0</maven-source-plugin.version>
        <maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
        <maven-versions-plugin.version>2.21.0</maven-versions-plugin.version>
        <maven-jar-plugin.version>3.5.1</maven-jar-plugin.version>
        <maven-shade-plugin.version>3.6.2</maven-shade-plugin.version>
        <maven-deploy-plugin.version>3.1.4</maven-deploy-plugin.version>
        <maven-install-plugin.version>3.1.4</maven-install-plugin.version>
        <maven-clean-plugin.version>3.5.0</maven-clean-plugin.version>
        <maven-central-publishing-plugin.version>0.11.0</maven-central-publishing-plugin.version>
        <license-maven-plugin.version>5.1.2</license-maven-plugin.version>
        <maven-install-plugin.version>3.1.4</maven-install-plugin.version>
        <maven-enforcer-plugin.version>3.6.3</maven-enforcer-plugin.version>

        <testcontainers.version>2.0.5</testcontainers.version>
        <logback-classic.version>1.6.3</logback-classic.version>
        <micrometer.version>1.17.1</micrometer.version>
        <micrometer-tracing.version>1.7.1</micrometer-tracing.version>
        <opentelemetry.version>1.65.0</opentelemetry.version>
        <postgres.version>42.7.13</postgres.version>
        <jackson.version>2.22.2</jackson.version>

        <assertj-core.version>3.27.7</assertj-core.version>
        <junit.jupiter.version>6.1.3</junit.jupiter.version>
        <awaitility.version>4.3.0</awaitility.version>
        <json-path.version>3.0.0</json-path.version>
        <slf4j.version>2.0.18</slf4j.version>
        <!-- PostBatchHandler depends on two behaviours of this version that are not part of any published contract:
             UndertowInputStream.close() reads the request body to the end, and available() reports a finished body
             as -1 rather than 0. Both are covered by Issue5470BatchErrorDeliveryIT, so a bump that changes either
             shows up as a test failure there rather than as a silently worse diagnosis (issue #5470). -->
        <undertow-core.version>2.4.3.Final</undertow-core.version>
        <jboss-threads.version>3.9.2</jboss-threads.version>
        <mockito-core.version>5.23.0</mockito-core.version>
        <neo4j-driver.version>6.2.1</neo4j-driver.version>
        <byte-buddy.version>1.17.7</byte-buddy.version>
        <!-- ArcadeGremlin.parse() instanceof-checks TinkerPop's AddVertexStepContract/AddEdgeStepContract/
             AddPropertyStepContract interfaces (not the concrete step classes) to classify OperationType,
             because 3.8.1's gremlin-lang parser hands it GValue placeholder steps that only these contract
             interfaces - not the concrete classes - cover (issue #5838). A version bump must re-verify via
             javap that those contracts still exist and are still implemented by both the placeholder and the
             concrete step for addV/addE/property, or the widened-OperationType bug silently comes back; see
             docs/5838-gremlin-parse-over-widens-operationtype.md and
             gremlin/src/test/java/com/arcadedb/gremlin/ArcadeGremlinAnalyzeTest.java. See also gremlin/pom.xml's
             own comment on the paired antlr version (issue #5535). -->
        <gremlin.version>3.8.1</gremlin.version>


        <protobuf-maven-plugin.version>5.1.8</protobuf-maven-plugin.version>
        <grpc.version>1.79.0</grpc.version>
        <protoc.version>4.33.0</protoc.version>
        <protobuf-java.version>4.36.0</protobuf-java.version>
        <com.google.api.grpc.version>2.75.0</com.google.api.grpc.version>
        <javax.annotation-api.version>1.3.2</javax.annotation-api.version>

        <maven-enforcer-plugin.version>3.6.3</maven-enforcer-plugin.version>
    </properties>

    <developers>
        <developer>
            <id>lgarulli</id>
            <name>Luca Garulli</name>
            <email>l.garulli@arcadedata.com</email>
            <timezone>-7</timezone>
        </developer>
        <developer>
            <id>robfrank</id>
            <name>Roberto Franchini</name>
            <email>r.franchini@arcadedata.com</email>
            <timezone>+1</timezone>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:https://github.com/ArcadeData/arcadedb.git</connection>
        <url>https://github.com/ArcadeData/arcadedb</url>
        <tag>HEAD</tag>
    </scm>

    <modules>
        <module>engine</module>
        <module>network</module>
        <module>grpc</module>
        <module>server</module>
        <module>mcp</module>
        <module>ha-raft</module>
        <module>metrics</module>
        <module>tracing</module>
        <module>integration</module>
        <module>console</module>
        <module>gremlin</module>
        <module>gremlin-it</module>
        <module>gremlin-consumer-it</module>
        <module>graphql</module>
        <module>mongodbw</module>
        <module>redisw</module>
        <module>postgresw</module>
        <module>bolt</module>
        <module>grpcw</module>
        <module>grpc-client</module>
        <module>coverage</module>
        <module>studio</module>
        <module>package</module>
        <module>e2e</module>
        <module>load-tests</module>
        <module>e2e-ha</module>
    </modules>

    <build>
        <resources>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${maven-resources-plugin.version}</version>
                <configuration>
                    <nonFilteredFileExtensions>jpg,jpeg,gif,bmp,png,svg,ttf,woff,woff2,swf</nonFilteredFileExtensions>
                    <propertiesEncoding>${project.build.sourceEncoding}</propertiesEncoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <source>${maven-compiler-plugin.release}</source>
                    <target>${maven-compiler-plugin.release}</target>
                    <compilerArgs>
                        <arg>--add-exports</arg>
                        <arg>java.management/sun.management=ALL-UNNAMED</arg>
                        <!-- TimeSeries SIMD: requires Java 21+. Uses jdk.incubator.vector (JEP 448).
                             Will migrate to the stable Vector API once it graduates from incubator. -->
                        <arg>--add-modules</arg>
                        <arg>jdk.incubator.vector</arg>
                    </compilerArgs>
                </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>
                <!-- Remove the databases a previous test run left in target/ before this one starts.
                     A test fixture that creates a database and is killed before its @AfterEach drops it -
                     an external SIGTERM, an IDE stop button, a `kill` on a hung fork - leaves the directory
                     behind, and DatabaseFactory.create() refuses to overwrite an existing database. The NEXT
                     run of that class then fails in setup with "Database ... already exists", so one kill
                     costs two runs and the failure names the fixture rather than the kill that caused it.
                     `mvn clean` already fixed it; this makes `mvn test` fix it too.

                     excludeDefaultDirectories is essential: without it this execution would delete the whole
                     of target/, including the classes compiled moments earlier. -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>${maven-clean-plugin.version}</version>
                <executions>
                    <execution>
                        <id>remove-stale-test-databases</id>
                        <phase>process-test-classes</phase>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                        <configuration>
                            <excludeDefaultDirectories>true</excludeDefaultDirectories>
                            <filesets>
                                <fileset>
                                    <directory>${project.build.directory}/databases</directory>
                                </fileset>
                            </filesets>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <!-- Skip @Tag("benchmark") classes by default (issue #5697). Sourced from the
                         ${excludedGroups} property above so -DexcludedGroups=... on the command line
                         still overrides it, e.g. benchmark-tests.yml clears it to run benchmarks and
                         mvn-test.yml widens it to slow,benchmark,vector for the default lane. -->
                    <excludedGroups>${excludedGroups}</excludedGroups>
                    <properties>
                        <!-- Work around. Surefire does not include enough
                             information to disambiguate between different
                             examples and scenarios. -->
                        <configurationParameters>
                            cucumber.junit-platform.naming-strategy=long
                        </configurationParameters>
                    </properties>
                    <!--                            cucumber.filter.name="not .*IT.*"-->
                    <forkedProcessExitTimeoutInSeconds>60</forkedProcessExitTimeoutInSeconds>
                    <forkCount>1</forkCount>
                    <systemPropertyVariables>
                        <polyglot.engine.WarnInterpreterOnly>false</polyglot.engine.WarnInterpreterOnly>
                    </systemPropertyVariables>
                    <argLine>
                        @{argLine}
                        -javaagent:${settings.localRepository}/net/bytebuddy/byte-buddy-agent/${byte-buddy.version}/byte-buddy-agent-${byte-buddy.version}.jar
                        --add-exports java.management/sun.management=ALL-UNNAMED
                        --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED
                        --add-opens java.base/java.nio.channels.spi=ALL-UNNAMED
                        --add-modules jdk.incubator.vector <!-- TimeSeries SIMD (Java 21+, incubating) -->
                        --enable-native-access=ALL-UNNAMED
                    </argLine>
                    <skipTests>${skipTests}</skipTests>
                    <excludes>
                        <exclude>**/*IT.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${maven-failsafe-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <excludes>
                        <!--                        <exclude>**/*HASplitBrainIT.java</exclude>-->
                        <!--                        <exclude>**/*HTTP2ServersIT.java</exclude>-->
                        <!--                    com/arcadedb/integration/backup/FullBackupIT.java,-->
                        <!--                    com/arcadedb/server/ha/HASplitBrainIT.java,-->
                        <!--                    com/arcadedb/server/ha/ReplicationServerQuorumMajority2ServersOutIT.java-->
                        <!--                        <exclude>**/IndexOperations3ServersIT.java</exclude>-->
                        <!--                        <exclude>**/ArcadeGraphProcessDebugTest.java</exclude>-->
                        <!--                        <exclude>**/ArcadeGraphStructureDebugTest.java</exclude>-->
                        <!--                        <exclude>**/*ReplicationServerReplicaRestartForceDbInstallIT.java</exclude>-->
                        <!--                        <exclude>**/*HARandomCrashIT.java</exclude>-->
                        <!--                        <exclude>**/*ReplicationServerLeaderDownIT</exclude>-->
                        <exclude>**/*ReplicationServerLeaderChanges3TimesIT</exclude>
                    </excludes>
                    <!-- Explicit, namespaced override of failsafe's excludedGroups (issue #5697): keeps
                         it independent of the surefire-only ${excludedGroups} default set above. -->
                    <excludedGroups>${failsafe.excludedGroups}</excludedGroups>
                    <skipTests>${skipITs}</skipTests>
                    <skipITs>${skipITs}</skipITs>
                    <excludeJUnit5Engines>
                        <excludeJUnit5Engine>cucumber</excludeJUnit5Engine>
                    </excludeJUnit5Engines>
                    <argLine>${itCoverageAgent}</argLine>
                    <reuseForks>true</reuseForks>
                    <forkedProcessExitTimeoutInSeconds>60</forkedProcessExitTimeoutInSeconds>
                    <forkCount>1</forkCount>
                    <systemPropertyVariables>
                        <polyglot.engine.WarnInterpreterOnly>false</polyglot.engine.WarnInterpreterOnly>
                    </systemPropertyVariables>
                    <argLine>
                        @{itCoverageAgent}
                        -javaagent:${settings.localRepository}/net/bytebuddy/byte-buddy-agent/${byte-buddy.version}/byte-buddy-agent-${byte-buddy.version}.jar
                        --add-exports java.management/sun.management=ALL-UNNAMED
                        --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED
                        --add-opens java.base/java.nio.channels.spi=ALL-UNNAMED
                        --enable-native-access=ALL-UNNAMED
                    </argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>${maven-install-plugin.version}</version>
                <configuration>
                    <allowIncompleteProjects>true</allowIncompleteProjects>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${license-maven-plugin.version}</version>
                <configuration>
                    <properties>
                        <year>${project.inceptionYear}-present</year>
                        <owner>${project.organization.name}</owner>
                        <email>info@arcadedata.com</email>
                    </properties>
                    <useDefaultExcludes>true</useDefaultExcludes>
                    <licenseSets>
                        <licenseSet>
                            <header>com/mycila/maven/plugin/license/templates/APACHE-2.txt</header>
                            <excludes>
                                <exclude>**/README</exclude>
                                <exclude>**/Jenkinsfile</exclude>
                                <exclude>**/*.yml</exclude>
                                <exclude>**/*.yaml</exclude>
                                <exclude>**/*.txt</exclude>
                                <exclude>src/test/resources/**</exclude>
                                <exclude>src/main/resources/**</exclude>
                            </excludes>
                        </licenseSet>
                    </licenseSets>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>${maven-central-publishing-plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <autoPublish>true</autoPublish>
                    <excludeArtifacts>
                        arcadedb-coverage,arcadedb-e2e,arcadedb-e2e-perf,arcadedb-e2e-ha
                    </excludeArtifacts>
                </configuration>
            </plugin>
            <!-- #5651: this configuration only takes effect when the goal is invoked by its bare
                 Maven coordinates (no pinned version), so it resolves against this declaration -
                 see .github/workflows/license-compliance.yml and
                 .github/scripts/check-license-allowlist.py, which is the actual allow/deny
                 enforcement and does its own matching on the raw (possibly un-merged) license
                 text rather than depending on licenseMerges/excludedLicenses below having fired. -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>2.7.1</version>
                <configuration>
                    <licenseMerges>
                        <!-- Group similar licenses to avoid duplicates in the human-facing report -->
                        <licenseMerge>Apache License 2.0|Apache 2.0|Apache License, Version 2.0|The Apache Software License, Version 2.0|Apache-2.0</licenseMerge>
                        <licenseMerge>MIT License|MIT|The MIT License</licenseMerge>
                        <licenseMerge>BSD 3-Clause|BSD-3-Clause|3-Clause BSD License|BSD 3-Clause License</licenseMerge>
                        <licenseMerge>BSD 2-Clause|BSD-2-Clause|2-Clause BSD License</licenseMerge>
                        <licenseMerge>EPL 1.0|Eclipse Public License 1.0|Eclipse Public License - v 1.0</licenseMerge>
                        <licenseMerge>EPL 2.0|Eclipse Public License 2.0|Eclipse Public License - v 2.0</licenseMerge>
                        <licenseMerge>LGPL 2.1|LGPL-2.1|GNU Lesser General Public License v2.1|LGPL 2.1 or later</licenseMerge>
                        <licenseMerge>UPL 1.0|UPL-1.0|Universal Permissive License, Version 1.0|The Universal Permissive License (UPL), Version 1.0</licenseMerge>
                        <licenseMerge>EDL 1.0|EDL-1.0|Eclipse Distribution License - v 1.0|Eclipse Distribution License v. 1.0</licenseMerge>
                        <licenseMerge>CC0 1.0 Universal|CC0-1.0|CC0|Public Domain</licenseMerge>
                    </licenseMerges>
                    <failOnBlacklist>true</failOnBlacklist>
                    <excludedLicenses>
                        <!-- Licenses incompatible with Apache 2.0 -->
                        <excludedLicense>GPL</excludedLicense>
                        <excludedLicense>AGPL</excludedLicense>
                        <excludedLicense>LGPL 2.0</excludedLicense>
                        <excludedLicense>SSPL</excludedLicense>
                        <excludedLicense>Commons Clause</excludedLicense>
                    </excludedLicenses>
                </configuration>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${maven-assembly-plugin.version}</version>
                    <configuration>
                        <tarLongFileMode>posix</tarLongFileMode>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin.version}</version>
                    <configuration>
                        <skipIfEmpty>true</skipIfEmpty>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>test-jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${maven-shade-plugin.version}</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <shadedArtifactAttached>true</shadedArtifactAttached>
                        <shadedClassifierName>shaded</shadedClassifierName>
                        <shadeTestJar>false</shadeTestJar>
                        <minimizeJar>false</minimizeJar>
                        <promoteTransitiveDependencies>false</promoteTransitiveDependencies>
                        <createDependencyReducedPom>false</createDependencyReducedPom>
                        <transformers>
                            <transformer
                                    implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                            <transformer
                                    implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
                            <transformer
                                    implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
                                <addHeader>false</addHeader>
                            </transformer>
                            <transformer
                                    implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                <manifestEntries>
                                    <!-- Required for GraalVM/Truffle to initialize correctly when bundled in shaded JARs.
                                         Without this, Truffle's CheckMultiReleaseSupport returns false (base class),
                                         causing Engine$ImplHolder initialization failure. -->
                                    <Multi-Release>true</Multi-Release>
                                </manifestEntries>
                            </transformer>
                        </transformers>
                        <filters>
                            <filter>
                                <artifact>*:*</artifact>
                                <excludes>
                                    <exclude>META-INF/*.SF</exclude>
                                    <exclude>META-INF/*.DSA</exclude>
                                    <exclude>META-INF/*.RSA</exclude>
                                </excludes>
                            </filter>
                        </filters>
                    </configuration>
                </plugin>

                <!-- gRPC Protobuf Plugin -->
                <plugin>
                    <groupId>io.github.ascopes</groupId>
                    <artifactId>protobuf-maven-plugin</artifactId>
                    <version>${protobuf-maven-plugin.version}</version>
                    <configuration>
                        <protoc>${protoc.version}</protoc>
                        <embedSourcesInClassOutputs>true</embedSourcesInClassOutputs>
                        <plugins>
                            <plugin kind="binary-maven">
                                <groupId>io.grpc</groupId>
                                <artifactId>protoc-gen-grpc-java</artifactId>
                                <version>${grpc.version}</version>
                            </plugin>
                        </plugins>
                        <sourceDirectories>
                            <sourceDirectory>${project.basedir}/src/main/proto</sourceDirectory>
                            <sourceDirectory>${project.basedir}/src/generated/proto</sourceDirectory>
                        </sourceDirectories>
                        <outputDirectory>src/generated/protobuf/java</outputDirectory>
                        <includes>
                            <include>*.proto</include>
                            <include>**/*.proto</include>
                        </includes>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>generate</goal>
                            </goals>
                            <configuration>
                                <sourceDirectories>
                                    <sourceDirectory>${project.basedir}/src/generated/proto</sourceDirectory>
                                    <sourceDirectory>${project.basedir}/src/main/proto</sourceDirectory>
                                </sourceDirectories>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

            </plugins>
        </pluginManagement>
    </build>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit.jupiter.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-bom</artifactId>
                <version>${assertj-core.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- Pin the whole Jackson family through the BOM. Transitive deps (swagger-core in the
                 server module, gremlin in the graph modules) drag in split Jackson versions, which
                 both reopens fixed deserialization CVEs and risks mixing databind against an older
                 jackson-core than it was compiled for. One managed version keeps the family aligned. -->
            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <version>${jackson.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- OpenTelemetry + Micrometer Tracing BOMs: consumed only by the optional `tracing`
                 module so the OTel SDK stays off the core/server compile classpath. -->
            <dependency>
                <groupId>io.micrometer</groupId>
                <artifactId>micrometer-tracing-bom</artifactId>
                <version>${micrometer-tracing.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>io.opentelemetry</groupId>
                <artifactId>opentelemetry-bom</artifactId>
                <version>${opentelemetry.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- Override jboss-threads transitive dependency from undertow-core
                 to remove sun.misc.Unsafe usage (terminally deprecated in Java 25) -->
            <dependency>
                <groupId>org.jboss.threads</groupId>
                <artifactId>jboss-threads</artifactId>
                <version>${jboss-threads.version}</version>
            </dependency>
            <!-- Pin protobuf-java across all modules. Transitive deps (e.g. opentelemetry-proto
                 pulled by micrometer-registry-otlp in the metrics module) drag in an older
                 protobuf-java than the gRPC gencode was compiled against, which fails at runtime
                 with "Detected incompatible Protobuf Gencode/Runtime versions" since the runtime
                 must not be older than the linked gencode. -->
            <dependency>
                <groupId>com.google.protobuf</groupId>
                <artifactId>protobuf-java</artifactId>
                <version>${protobuf-java.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.protobuf</groupId>
                <artifactId>protobuf-java-util</artifactId>
                <version>${protobuf-java.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- SLF4J JUL binding, TEST scope only. ArcadeDB is a library: it must expose the slf4j-api
             facade but never force a binding onto downstream consumers (a compile/runtime binding
             here would leak transitively and require every embedder to add exclusions). Kept at test
             scope so module tests still emit logs (through java.util.logging, matching the test
             arcadedb-log.properties). The runnable artifacts declare their own runtime binding
             (see console/pom.xml and package/pom.xml). -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk14</artifactId>
            <version>${slf4j.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito-core.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <version>${awaitility.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.jayway.jsonpath</groupId>
            <artifactId>json-path</artifactId>
            <version>${json-path.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>deploy</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven-javadoc-plugin.version}</version>
                        <configuration>
                            <doclint>none</doclint>  <!-- Turnoff all checks -->
                            <additionalOptions>
                                <!-- TimeSeries SIMD: requires jdk.incubator.vector module (JEP 448) -->
                                <additionalOption>--add-modules jdk.incubator.vector</additionalOption>
                            </additionalOptions>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>deploy-central</id>
            <build>
                <plugins>
                    <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>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>versions-maven-plugin</artifactId>
                        <version>${maven-versions-plugin.version}</version>
                        <configuration>
                            <generateBackupPoms>false</generateBackupPoms>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>coverage</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${jacoco-maven-plugin.version}</version>
                        <configuration>
                            <excludes>
                                <exclude>com/arcadedb/graphql/parser/**/*</exclude>
                                <exclude>com/arcadedb/query/sql/parser/*</exclude>
                                <exclude>**/static/*</exclude>
                                <exclude>**/*.bat</exclude>
                                <exclude>**/*.sh</exclude>
                                <exclude>**/*.md</exclude>
                                <exclude>**/*.yml</exclude>
                                <exclude>**/*.yaml</exclude>
                                <exclude>LICENCE</exclude>
                                <exclude>Jenkinsfile</exclude>
                            </excludes>
                        </configuration>
                        <executions>
                            <execution>
                                <id>prepare-unit</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <!-- prepare agent before integration tests -->
                            <execution>
                                <id>prepare-it</id>
                                <goals>
                                    <goal>prepare-agent-integration</goal>
                                </goals>
                                <phase>pre-integration-test</phase>
                                <configuration>
                                    <destFile>${project.build.directory}/jacoco-it.exec</destFile>
                                    <propertyName>itCoverageAgent</propertyName>
                                </configuration>
                            </execution>
                            <execution>
                                <id>report</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report-it</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>report-integration</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>full</id>
            <properties>
                <skipITs>false</skipITs>
            </properties>
        </profile>
        <profile>
            <id>integration</id>
            <properties>
                <skipITs>false</skipITs>
            </properties>
        </profile>
        <profile>
            <id>windows</id>
            <activation>
                <os>
                    <family>windows</family>
                </os>
            </activation>
            <properties>
                <exclude.tests>**/gremlin/**/*.java</exclude.tests>
            </properties>
        </profile>
        <profile>
            <id>native</id>
            <modules>
                <module>native</module>
            </modules>
        </profile>

    </profiles>
</project>
