<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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>
    <name>Summit AST</name>
    <description>Summit - Apex Language Abstract Syntax Tree</description>
    <url>https://github.com/adangel/summit-ast</url>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>
    <scm>
        <connection>scm:git:ssh://git@github.com/adangel/summit-ast.git</connection>
        <!-- maven-release-plugin pushes to this URL, not to any configured git remote. -->
        <developerConnection>scm:git:ssh://git@github.com/adangel/summit-ast.git</developerConnection>
        <tag>release/3.1.0</tag>
        <url>https://github.com/adangel/summit-ast.git</url>
    </scm>
    <groupId>com.github.adangel</groupId>
    <artifactId>summit-ast</artifactId>
    <version>3.1.0</version>

    <properties>
        <!-- Reproducible builds: maven-release-plugin sets this to the release date
             while it rewrites the versions, so it needs no manual bumping.
             See https://maven.apache.org/guides/mini/guide-reproducible-builds.html -->
        <project.build.outputTimestamp>2026-08-27T14:50:32Z</project.build.outputTimestamp>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.release>8</maven.compiler.release>
        <kotlin.version>1.9.0</kotlin.version>
        <!-- The api and the test binding have to stay on the same version. -->
        <slf4j.version>1.7.36</slf4j.version>
        <!-- Incremental compilation carries state across builds, so the output could
             depend on what was compiled before. Reproducible builds are full builds. -->
        <kotlin.compiler.incremental>false</kotlin.compiler.incremental>
        <!-- The njord extension and the njord plugin must be kept on the same version. -->
        <version.njord>0.9.10</version.njord>
        <!-- The publishing service the staged artifacts are destined for. Only used to
             validate the staged store against its rules (njord:validate) - the upload
             itself is done by hand, so njord never contacts the service. -->
        <njord.publisher>sonatype-cp</njord.publisher>
    </properties>

    <!-- Nothing is ever uploaded by the build: "deploy" hands the artifacts to njord,
     which stages them locally. The bundle for Maven Central is written from that
     store and uploaded to the Central Portal by hand - see docs/releasing.md. The
     "-sca" template adds SHA-512 and SHA-256 checksums to the default SHA-1/MD5.
     Snapshots are not published anywhere either, but the snapshotRepository has to
     be here: njord:status fails with a NullPointerException without it. -->
    <distributionManagement>
        <repository>
            <id>njord</id>
            <url>njord:template:release-sca</url>
        </repository>
        <snapshotRepository>
            <id>njord</id>
            <url>njord:template:snapshot-sca</url>
        </snapshotRepository>
    </distributionManagement>

    <!-- Versions of transitive dependencies are pinned here, so that they don't
         float with whatever our direct dependencies happen to declare. These are
         not direct dependencies, so they must not be listed in <dependencies>. -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.google.errorprone</groupId>
                <artifactId>error_prone_annotations</artifactId>
                <version>2.50.0</version>
            </dependency>
            <dependency>
                <groupId>org.jspecify</groupId>
                <artifactId>jspecify</artifactId>
                <version>1.0.1</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- The logging facade only. No binding is declared outside of test scope: a
             library must leave the choice of a backend to the application that embeds it.
             Stay on the 1.7 line - a 1.7 binding is found through
             org.slf4j.impl.StaticLoggerBinder, while slf4j-api 2.x instead looks up an
             org.slf4j.spi.SLF4JServiceProvider via ServiceLoader. PMD, which embeds this
             library, is on 1.7.36, and an slf4j-api 2.x here would leave its binding
             undiscovered and log nothing at all. -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.antlr</groupId>
            <artifactId>antlr4-runtime</artifactId>
            <version>4.13.2</version>
        </dependency>
        <dependency>
            <groupId>io.github.apex-dev-tools</groupId>
            <artifactId>apex-parser</artifactId>
            <version>5.2.0</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.14.0</version>
        </dependency>
        <dependency>
            <groupId>org.danilopianini</groupId>
            <artifactId>gson-extras</artifactId>
            <version>3.3.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.20.0</version>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
            <version>${kotlin.version}</version>
        </dependency>
        <!-- Needed by the serializer, which uses full Kotlin reflection at runtime.
             Nothing compiles against it, hence runtime scope. -->
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-reflect</artifactId>
            <version>${kotlin.version}</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.truth</groupId>
            <artifactId>truth</artifactId>
            <version>1.4.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-test</artifactId>
            <version>${kotlin.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- A binding, so that the log output of the library is actually visible while
             testing and while running SummitTool - see the exec-maven-plugin below. -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>${slf4j.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <!-- Provides the "njord:" transport that distributionManagement above refers to.
             It has to be here and not in the "sign" profile, as <extensions> is not
             allowed inside a profile. The extension stays dormant during normal builds,
             it only registers the transport. -->
        <extensions>
            <extension>
                <groupId>eu.maveniverse.maven.njord</groupId>
                <artifactId>extension3</artifactId>
                <version>${version.njord}</version>
            </extension>
        </extensions>

        <!-- All plugin versions are pinned here, so that the build does not depend on
             the default lifecycle bindings of whichever Maven version happens to run it. -->
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.6.3</version>
                </plugin>
                <plugin>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-maven-plugin</artifactId>
                    <version>${kotlin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.15.0</version>
                </plugin>

                <!-- Bound to the lifecycle, but not declared below: without these the
                     versions would come from Maven's own default bindings. -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.2.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.4.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.5.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.5.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.4.0</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>3.6.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>3.1.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.1.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.12.1</version>
                </plugin>

                <!-- Not bound to the lifecycle; invoked from the command line to run the
                     SummitTool demonstration executable, see README.md. The only SLF4J
                     binding in this build is test-scoped, so the tool needs the test
                     classpath to produce any output at all. -->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>3.6.3</version>
                    <configuration>
                        <classpathScope>test</classpathScope>
                    </configuration>
                </plugin>

                <!-- Not bound to the lifecycle; invoked from the command line to verify
                     that the build is reproducible:
                       ./mvnw artifact:check-buildplan
                       ./mvnw clean install && ./mvnw clean verify artifact:compare
                     The compare has to be a second, separate invocation: it resolves the
                     reference build from the local repository, so installing and comparing
                     in one command would compare the build against itself. See
                     docs/releasing.md. -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-artifact-plugin</artifactId>
                    <version>3.6.1</version>
                </plugin>

                <!-- Maven Central requires a javadoc artifact. The Kotlin sources are not
                     documented, that would need Dokka - the only Java sources are
                     src/main/java/com/google/summit/{package-info,Javadoc}.java, which
                     exist solely so that the javadoc jar isn't empty (javadoc refuses to
                     run without at least one public class). The configuration below keeps
                     the generated output reproducible. Note that javadoc output also
                     varies with the JDK version, which the enforcer pins. -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.12.0</version>
                    <configuration>
                        <!-- Omit the "Generated by javadoc on <date>" comment. -->
                        <notimestamp>true</notimestamp>
                        <!-- Without this, headings and sort order follow the locale
                             of the machine running the build. -->
                        <locale>en_US</locale>
                        <additionalJOptions>
                            <additionalJOption>-J-Duser.language=en</additionalJOption>
                            <additionalJOption>-J-Duser.country=US</additionalJOption>
                        </additionalJOptions>
                    </configuration>
                </plugin>

                <!-- Used when releasing, see docs/releasing.md. -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>3.3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.2.8</version>
                </plugin>
                <!-- Note: the artifactId is "njord", there is no "njord-maven-plugin".
                     The goal prefix is "njord". Not bound to the lifecycle; invoked from
                     the command line to inspect the local staging store and to write the
                     bundle for Maven Central. -->
                <plugin>
                    <groupId>eu.maveniverse.maven.plugins</groupId>
                    <artifactId>njord</artifactId>
                    <version>${version.njord}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-versions</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <message>This project must be built with Java 17.</message>
                                    <version>[17,18)</version>
                                </requireJavaVersion>
                                <requireMavenVersion>
                                    <message>This project must be built with Maven 3.</message>
                                    <version>[3.9.16,4.0.0)</version>
                                </requireMavenVersion>
                                <banDynamicVersions>
                                    <message>The dependency versions must be fixed, so that the build is reproducible.</message>
                                    <allowSnapshots>false</allowSnapshots>
                                </banDynamicVersions>
                            </rules>
                        </configuration>
                    </execution>
                    <execution>
                        <id>enforce-bytecode-version</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <enforceBytecodeVersion>
                                    <message>The dependencies must be compatible with Java ${maven.compiler.release}.</message>
                                    <maxJdkVersion>${maven.compiler.release}</maxJdkVersion>
                                    <ignoredScopes>
                                        <ignoredScope>test</ignoredScope>
                                    </ignoredScopes>
                                </enforceBytecodeVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>extra-enforcer-rules</artifactId>
                        <version>1.12.0</version>
                    </dependency>
                </dependencies>
            </plugin>
            <!-- Kotlin compiler plugin configuration -->
            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>kotlin-compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <sourceDirs>
                                <sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
                                <!-- Ensure Kotlin code can reference Java code -->
                                <sourceDir>${project.basedir}/src/main/java</sourceDir>
                            </sourceDirs>
                        </configuration>
                    </execution>
                    <execution>
                        <id>kotlin-test-compile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                        <configuration>
                            <sourceDirs>
                                <sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
                                <sourceDir>${project.basedir}/src/test/java</sourceDir>
                            </sourceDirs>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- Maven compiler plugin configuration for Java classes -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <executions>
                    <!-- Disable default executions -->
                    <execution>
                        <id>default-compile</id>
                        <phase>none</phase>
                    </execution>
                    <execution>
                        <id>default-testCompile</id>
                        <phase>none</phase>
                    </execution>

                    <!-- Define custom executions -->
                    <execution>
                        <id>java-compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>java-test-compile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- kotlin-maven-plugin reads src/main/kotlin, but doesn't register it as
                 a source root of the project. Without this, the sources artifact created
                 below would only contain the Java sources. -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-kotlin-sources</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.basedir}/src/main/kotlin</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Maven Central requires sources and javadoc artifacts. Both are built
                 on every run, so that the reproducibility check (artifact:compare)
                 covers them as well. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>package</phase>
                        <goals>
                            <!-- "jar-no-fork" instead of "jar", to avoid running the
                                 generate-sources phase a second time. -->
                            <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>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Releases are signed and staged locally: release:perform activates the
                 "sign" profile below in the build it forks off the tag, and the deploy
                 of that build goes into njord (see distributionManagement above). -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <releaseProfiles>sign</releaseProfiles>
                    <!-- The existing tags are named release/3.0.1, not summit-ast-3.0.1. -->
                    <tagNameFormat>release/@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!-- Maven Central requires a detached GPG signature for every deployed artifact.
             Signing is kept out of the normal build: it would ask for a passphrase on
             every "mvnw verify", and signatures are not reproducible. The profile is
             activated by the releaseProfiles setting of maven-release-plugin above, or
             by hand with -Psign. -->
        <profile>
            <id>sign</id>
            <build>
                <plugins>
                    <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>
                            </execution>
                        </executions>
                        <configuration>
                            <!-- Take the passphrase from MAVEN_GPG_PASSPHRASE or from
                                 gpg-agent only, and fail if it is passed any other way
                                 (-Dgpg.passphrase or settings.xml). That is what
                                 maven-gpg-plugin 4.x will enforce unconditionally. -->
                            <bestPractices>true</bestPractices>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- Which key to sign with. The gpg signer has no environment variable of its own
             for that (MAVEN_GPG_KEY_FINGERPRINT is honored by the "bc" signer only), but
             Maven exposes every environment variable as a property "env.<NAME>", so it can
             be forwarded to the signer's own "gpg.keyname" property, which it passes on
             as the "local-user" option of gpg. Unlike -Dgpg.keyname, an environment
             variable is inherited by the build that release:perform forks. Without the
             variable, gpg picks its default key.

             Note that "keyname" is deliberately not configured on the plugin itself: the
             property alone is enough, and an undefined property would otherwise end up
             as a literal "${gpg.keyname}" on the gpg command line. -->
        <profile>
            <id>sign-key-from-env</id>
            <activation>
                <property>
                    <name>env.MAVEN_GPG_KEY_FINGERPRINT</name>
                </property>
            </activation>
            <properties>
                <gpg.keyname>${env.MAVEN_GPG_KEY_FINGERPRINT}</gpg.keyname>
            </properties>
        </profile>
    </profiles>

    <developers>
        <developer>
            <name>Aaron Hurst</name>
            <email>aaronpaulhurst@gmail.com</email>
        </developer>
        <developer>
            <name>Aaron Hurst</name>
            <email>aaronhurst@google.com</email>
            <organization>Google</organization>
            <organizationUrl>http://www.google.com</organizationUrl>
        </developer>
        <developer>
            <name>Z for Zorzella</name>
            <email>zorzella@google.com</email>
            <organization>Google</organization>
            <organizationUrl>http://www.google.com</organizationUrl>
        </developer>
        <developer>
            <name>Edward Klimoshenko</name>
            <email>eklimo@google.com</email>
            <organization>Google</organization>
            <organizationUrl>http://www.google.com</organizationUrl>
        </developer>
        <developer>
            <name>Andreas Dangel</name>
            <email>andreas.dangel@adangel.org</email>
        </developer>
    </developers>

</project>
