<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>site.tracegraph</groupId>
    <artifactId>tracegraph-parent</artifactId>
    <version>0.4.0</version>
    <packaging>pom</packaging>

    <name>TraceGraph (parent)</name>
    <description>A production-grade agent runtime for the JVM — typed graphs, durable memory, deep observability.</description>
    <url>https://github.com/kimhongzhang323/TraceGraph</url>
    <inceptionYear>2026</inceptionYear>

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

    <developers>
        <developer>
            <id>kimhongzhang323</id>
            <name>Kim Hong Zhang</name>
            <email>kim.hong.zhang323@gmail.com</email>
            <url>https://github.com/kimhongzhang323</url>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/kimhongzhang323/TraceGraph</url>
        <connection>scm:git:https://github.com/kimhongzhang323/TraceGraph.git</connection>
        <developerConnection>scm:git:git@github.com:kimhongzhang323/TraceGraph.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/kimhongzhang323/TraceGraph/issues</url>
    </issueManagement>

    <distributionManagement>
        <!-- SNAPSHOT deploys go to GitHub Packages via the snapshot.yml CI workflow.
             Release deploys go to Maven Central via the release profile + release.yml.
             No <repository> entry here is intentional. -->
        <snapshotRepository>
            <id>github</id>
            <url>https://maven.pkg.github.com/kimhongzhang323/TraceGraph</url>
        </snapshotRepository>
    </distributionManagement>

    <modules>
        <module>tracegraph-bom</module>
        <module>tracegraph-core</module>
        <module>tracegraph-runtime</module>
        <module>tracegraph-memory</module>
        <module>tracegraph-observability</module>
        <module>tracegraph-spring-boot-starter</module>
        <module>tracegraph-connectors</module>
        <module>tracegraph-rag</module>
        <module>tracegraph-eval</module>
        <module>tracegraph-a2a</module>
        <module>tracegraph-bench</module>
        <module>tracegraph-e2e</module>
        <module>tracegraph-ui</module>
        <module>tracegraph-demo</module>
    </modules>

    <properties>
        <maven.compiler.release>21</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <slf4j.version>2.0.18</slf4j.version>
        <junit.version>6.0.3</junit.version>
        <assertj.version>3.27.7</assertj.version>
        <opentelemetry.version>1.62.0</opentelemetry.version>
        <spring-boot.version>4.0.6</spring-boot.version>
        <jackson.version>2.21.3</jackson.version>

        <maven-compiler-plugin.version>3.15.0</maven-compiler-plugin.version>
        <maven-surefire-plugin.version>3.5.5</maven-surefire-plugin.version>
        <maven-source-plugin.version>3.4.0</maven-source-plugin.version>
        <maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>
        <maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
        <central-publishing-maven-plugin.version>0.10.0</central-publishing-maven-plugin.version>
        <owasp-dependency-check.version>12.2.2</owasp-dependency-check.version>
        <cyclonedx-maven-plugin.version>2.9.1</cyclonedx-maven-plugin.version>
        <pitest-maven.version>1.23.1</pitest-maven.version>
        <pitest-junit5-plugin.version>1.2.3</pitest-junit5-plugin.version>

        <!-- Test tooling -->
        <equalsverifier.version>4.5</equalsverifier.version>
        <jqwik.version>1.9.3</jqwik.version>
        <wiremock.version>3.13.2</wiremock.version>
        <testcontainers.version>1.21.0</testcontainers.version>
        <archunit.version>1.4.2</archunit.version>

        <!-- default empty so @{argLine} in child modules resolves when coverage profile is inactive -->
        <argLine></argLine>

        <!-- Quality plugins -->
        <spotbugs-maven-plugin.version>4.9.8.3</spotbugs-maven-plugin.version>
        <spotbugs.version>4.9.8</spotbugs.version>
        <license-maven-plugin.version>5.0.0</license-maven-plugin.version>
        <jacoco-maven-plugin.version>0.8.14</jacoco-maven-plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.opentelemetry</groupId>
                <artifactId>opentelemetry-bom</artifactId>
                <version>${opentelemetry.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <version>${jackson.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>site.tracegraph</groupId>
                <artifactId>tracegraph-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>site.tracegraph</groupId>
                <artifactId>tracegraph-observability</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>site.tracegraph</groupId>
                <artifactId>tracegraph-memory</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>site.tracegraph</groupId>
                <artifactId>tracegraph-connectors</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>site.tracegraph</groupId>
                <artifactId>tracegraph-rag</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>site.tracegraph</groupId>
                <artifactId>tracegraph-eval</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>site.tracegraph</groupId>
                <artifactId>tracegraph-a2a</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>site.tracegraph</groupId>
                <artifactId>tracegraph-ui</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>1.5.32</version>
                <scope>test</scope>
            </dependency>

            <!-- Test tooling -->
            <dependency>
                <groupId>nl.jqno.equalsverifier</groupId>
                <artifactId>equalsverifier</artifactId>
                <version>${equalsverifier.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>net.jqwik</groupId>
                <artifactId>jqwik</artifactId>
                <version>${jqwik.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.wiremock</groupId>
                <artifactId>wiremock-standalone</artifactId>
                <version>${wiremock.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers-bom</artifactId>
                <version>${testcontainers.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.tngtech.archunit</groupId>
                <artifactId>archunit-junit5</artifactId>
                <version>${archunit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-annotations</artifactId>
                <version>${spotbugs.version}</version>
                <optional>true</optional>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <configuration>
                        <archive>
                            <manifestEntries>
                                <Automatic-Module-Name>${automatic.module.name}</Automatic-Module-Name>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <release>21</release>
                        <compilerArgs>
                            <arg>-Xlint:all</arg>
                            <arg>-Xlint:-serial</arg>
                            <arg>-Werror</arg>
                            <arg>-parameters</arg>
                        </compilerArgs>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                    <configuration>
                        <doclint>all,-missing</doclint>
                        <quiet>true</quiet>
                        <source>21</source>
                        <failOnError>true</failOnError>
                        <failOnWarnings>false</failOnWarnings>
                        <excludePackageNames>
                            io.tracegraph.demo.*,io.tracegraph.bench.*
                        </excludePackageNames>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <version>${central-publishing-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.owasp</groupId>
                    <artifactId>dependency-check-maven</artifactId>
                    <version>${owasp-dependency-check.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.cyclonedx</groupId>
                    <artifactId>cyclonedx-maven-plugin</artifactId>
                    <version>${cyclonedx-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-maven-plugin</artifactId>
                    <version>${spotbugs-maven-plugin.version}</version>
                    <configuration>
                        <effort>Max</effort>
                        <threshold>Medium</threshold>
                        <xmlOutput>true</xmlOutput>
                        <excludeFilterFile>${maven.multiModuleProjectDirectory}/spotbugs-exclude.xml</excludeFilterFile>
                        <plugins>
                            <plugin>
                                <groupId>com.h3xstream.findsecbugs</groupId>
                                <artifactId>findsecbugs-plugin</artifactId>
                                <version>1.14.0</version>
                            </plugin>
                        </plugins>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>${license-maven-plugin.version}</version>
                    <configuration>
                        <licenseSets>
                            <licenseSet>
                                <header>LICENSE-HEADER.txt</header>
                                <excludes>
                                    <exclude>**/src/test/**</exclude>
                                    <exclude>**/target/**</exclude>
                                    <exclude>**/*.xml</exclude>
                                    <exclude>**/*.properties</exclude>
                                    <exclude>**/*.json</exclude>
                                    <exclude>**/*.md</exclude>
                                    <exclude>**/*.yml</exclude>
                                    <exclude>**/*.yaml</exclude>
                                </excludes>
                            </licenseSet>
                        </licenseSets>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.pitest</groupId>
                    <artifactId>pitest-maven</artifactId>
                    <version>${pitest-maven.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.pitest</groupId>
                            <artifactId>pitest-junit5-plugin</artifactId>
                            <version>${pitest-junit5-plugin.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <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>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <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.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>false</autoPublish>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>security</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.owasp</groupId>
                        <artifactId>dependency-check-maven</artifactId>
                        <configuration>
                            <failBuildOnCVSS>7</failBuildOnCVSS>
                            <suppressionFile>${project.basedir}/dependency-check-suppressions.xml</suppressionFile>
                            <nvdApiKeyEnvironmentVariable>NVD_API_KEY</nvdApiKeyEnvironmentVariable>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>aggregate</goal>
                                </goals>
                                <phase>verify</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>mutation</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.pitest</groupId>
                        <artifactId>pitest-maven</artifactId>
                        <configuration>
                            <targetClasses>
                                <param>io.tracegraph.core.*</param>
                            </targetClasses>
                            <targetTests>
                                <param>io.tracegraph.core.*</param>
                            </targetTests>
                            <mutationThreshold>75</mutationThreshold>
                            <coverageThreshold>75</coverageThreshold>
                            <outputFormats>
                                <outputFormat>HTML</outputFormat>
                                <outputFormat>XML</outputFormat>
                            </outputFormats>
                            <timestampedReports>false</timestampedReports>
                            <threads>4</threads>
                        </configuration>
                        <executions>
                            <execution>
                                <id>pitest</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>mutationCoverage</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>sbom</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.cyclonedx</groupId>
                        <artifactId>cyclonedx-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>makeAggregateBom</goal>
                                </goals>
                                <phase>package</phase>
                            </execution>
                        </executions>
                        <configuration>
                            <projectType>library</projectType>
                            <schemaVersion>1.6</schemaVersion>
                            <includeBomSerialNumber>true</includeBomSerialNumber>
                            <includeCompileScope>true</includeCompileScope>
                            <includeProvidedScope>false</includeProvidedScope>
                            <includeRuntimeScope>true</includeRuntimeScope>
                            <includeSystemScope>false</includeSystemScope>
                            <includeTestScope>false</includeTestScope>
                            <outputReactorProjects>true</outputReactorProjects>
                            <outputFormat>json</outputFormat>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>docs</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <id>aggregate-javadoc</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>aggregate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>quality</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.spotbugs</groupId>
                        <artifactId>spotbugs-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>spotbugs-check</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>coverage</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-agent</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                                <configuration>
                                    <excludes>
                                        <exclude>io/tracegraph/demo/**</exclude>
                                        <exclude>io/tracegraph/bench/**</exclude>
                                    </excludes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
