<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright The OpenZipkin Authors
    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>io.zipkin.dependencies</groupId>
  <artifactId>zipkin-dependencies-parent</artifactId>
  <version>3.2.2</version>
  <packaging>pom</packaging>

  <modules>
    <module>cassandra3</module>
    <module>mysql</module>
    <module>elasticsearch</module>
    <module>opensearch</module>
    <module>main</module>
  </modules>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
    <project.build.outputEncoding>UTF-8</project.build.outputEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <main.basedir>${project.basedir}</main.basedir>

    <!-- All source is Java 17+ -->
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <!-- We don't use animal-sniffer anymore as release obviates it.
         See https://github.com/mojohaus/animal-sniffer/issues/62 -->
    <maven.compiler.release>17</maven.compiler.release>

    <maven.compiler.testSource>17</maven.compiler.testSource>
    <maven.compiler.testTarget>17</maven.compiler.testTarget>
    <!-- We don't use animal-sniffer anymore as release obviates it.
         See https://github.com/mojohaus/animal-sniffer/issues/62 -->
    <maven.compiler.testRelease>17</maven.compiler.testRelease>

    <!-- Spark 3.5 module config from:
         https://github.com/apache/spark/blob/branch-3.5/launcher/src/main/java/org/apache/spark/launcher/JavaModuleOptions.java#L29 -->
    <maven.test.argLine>
      -XX:+IgnoreUnrecognizedVMOptions
      --add-opens=java.base/java.lang=ALL-UNNAMED
      --add-opens=java.base/java.lang.invoke=ALL-UNNAMED
      --add-opens=java.base/java.lang.reflect=ALL-UNNAMED
      --add-opens=java.base/java.io=ALL-UNNAMED
      --add-opens=java.base/java.net=ALL-UNNAMED
      --add-opens=java.base/java.nio=ALL-UNNAMED
      --add-opens=java.base/java.util=ALL-UNNAMED
      --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
      --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED
      --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED
      --add-opens=java.base/sun.nio.ch=ALL-UNNAMED
      --add-opens=java.base/sun.nio.cs=ALL-UNNAMED
      --add-opens=java.base/sun.security.action=ALL-UNNAMED
      --add-opens=java.base/sun.util.calendar=ALL-UNNAMED
      --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED
      -Djdk.reflect.useDirectMethodHandle=false
    </maven.test.argLine>

    <!-- override to set exclusions per-project -->
    <errorprone.args />
    <!-- 2.43+ is Java 21 bytecode, can't use until Spark 4 (SPARK-43831) -->
    <errorprone.version>2.42.0</errorprone.version>

    <!-- Use a common scala binary version, and the highest spark patch. -->
    <scala.binary.version>2.13</scala.binary.version>
    <spark.version>3.5.8</spark.version>

    <!-- Used in opensearch and elasticsearch -->
    <okhttp.version>4.12.0</okhttp.version>

    <!-- This dependency is in elasticsearch-hadoop -->
    <elasticsearch-spark.version>9.3.2</elasticsearch-spark.version>

    <!-- This dependency is in opensearch-hadoop -->
    <opensearch-spark.version>1.2.0</opensearch-spark.version>

    <!-- Use latest Cassandra connector matching minor versioned of spark. -->
    <spark-cassandra-connector.version>3.5.1</spark-cassandra-connector.version>
    <java-driver.version>4.19.2</java-driver.version>

    <!-- Use zipkin's version of MariaDB client -->
    <mariadb-java-client.version>3.5.7</mariadb-java-client.version>

    <!-- CVE fix versions: re-evaluate after spark bumps -->
    <aircompressor.version>2.0.3</aircompressor.version>
    <commons-compress.version>1.28.0</commons-compress.version>
    <guava.version>33.5.0-jre</guava.version>
    <ivy.version>2.5.3</ivy.version>
    <!-- 1.9+ changed package from net.jpountz.lz4, incompatible with Spark 3.x -->
    <lz4-java.version>1.8.1</lz4-java.version>
    <protobuf.version>3.25.8</protobuf.version>
    <scala.version>2.13.18</scala.version>
    <zookeeper.version>3.9.5</zookeeper.version>

    <!-- Use BOM to align JUnit versions, as armeria 1.32 pulls older junit-jupiter-api -->
    <junit-jupiter.version>5.14.3</junit-jupiter.version>
    <testcontainers.version>2.0.4</testcontainers.version>

    <!-- These need to match zipkin, so that tests don't have classpath
         conflicts. When updating, also update IT*.java -->
    <zipkin.version>3.6.0</zipkin.version>
    <!-- 1.33+ needs netty 4.2, can't use until Spark supports it -->
    <armeria.version>1.32.5</armeria.version>
    <!-- 4.2+ breaks Spark's internal networking, can't use until Spark supports it -->
    <netty.version>4.1.131.Final</netty.version>
    <jackson.version>2.21.1</jackson.version>
    <assertj.version>3.27.7</assertj.version>
    <slf4j.version>2.0.17</slf4j.version>

    <license.skip>${skipTests}</license.skip>

    <go-offline-maven-plugin.version>1.2.8</go-offline-maven-plugin.version>
    <!-- TODO: cleanup any redundant ignores now also in the 4.0 release (once final) -->
    <license-maven-plugin.version>5.0.0</license-maven-plugin.version>
    <maven-bundle-plugin.version>5.1.9</maven-bundle-plugin.version>
    <maven-compiler-plugin.version>3.15.0</maven-compiler-plugin.version>
    <!-- Use same version as https://github.com/openzipkin/docker-java -->
    <maven-dependency-plugin.version>3.10.0</maven-dependency-plugin.version>
    <maven-deploy-plugin.version>3.1.4</maven-deploy-plugin.version>
    <maven-enforcer-plugin.version>3.6.2</maven-enforcer-plugin.version>
    <!-- Use same version as https://github.com/openzipkin/docker-java -->
    <maven-help-plugin.version>3.5.1</maven-help-plugin.version>
    <maven-install-plugin.version>3.1.4</maven-install-plugin.version>
    <maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>
    <maven-jar-plugin.version>3.5.0</maven-jar-plugin.version>
    <maven-release-plugin.version>3.3.1</maven-release-plugin.version>
    <maven-shade-plugin.version>3.6.2</maven-shade-plugin.version>
    <maven-source-plugin.version>3.4.0</maven-source-plugin.version>
    <maven-surefire-plugin.version>3.5.5</maven-surefire-plugin.version>
    <central-publishing-maven-plugin.version>0.10.0</central-publishing-maven-plugin.version>
    <flatten-maven-plugin.version>1.7.3</flatten-maven-plugin.version>
  </properties>

  <name>Zipkin Dependencies (Parent)</name>
  <description>Zipkin Dependencies (Parent)</description>
  <url>https://github.com/openzipkin/zipkin-dependencies</url>
  <inceptionYear>2016</inceptionYear>

  <organization>
    <name>OpenZipkin</name>
    <url>https://zipkin.io/</url>
  </organization>

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

  <scm>
    <url>https://github.com/openzipkin/zipkin-dependencies</url>
    <connection>scm:git:https://github.com/openzipkin/zipkin-dependencies.git</connection>
    <developerConnection>scm:git:https://github.com/openzipkin/zipkin-dependencies.git</developerConnection>
    <tag>3.2.2</tag>
  </scm>

  <!-- Developer section is needed for Maven Central, but doesn't need to include each person -->
  <developers>
    <developer>
      <id>openzipkin</id>
      <name>OpenZipkin Gitter</name>
      <url>https://gitter.im/openzipkin/zipkin</url>
    </developer>
  </developers>

  <distributionManagement>
    <snapshotRepository>
      <id>central</id>
      <url>https://central.sonatype.com/repository/maven-snapshots/</url>
    </snapshotRepository>
  </distributionManagement>

  <issueManagement>
    <system>Github</system>
    <url>https://github.com/openzipkin/zipkin-dependencies/issues</url>
  </issueManagement>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-bom</artifactId>
        <version>${netty.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>${junit-jupiter.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>com.linecorp.armeria</groupId>
        <artifactId>armeria-bom</artifactId>
        <version>${armeria.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>org.apache.spark</groupId>
        <artifactId>spark-core_${scala.binary.version}</artifactId>
        <version>${spark.version}</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson</groupId>
        <artifactId>jackson-bom</artifactId>
        <version>${jackson.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>org.apache.cassandra</groupId>
        <artifactId>java-driver-bom</artifactId>
        <version>${java-driver.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <!-- CVE fix versions -->
      <dependency>
        <groupId>org.lz4</groupId>
        <artifactId>lz4-java</artifactId>
        <version>${lz4-java.version}</version>
      </dependency>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>${guava.version}</version>
      </dependency>
      <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java</artifactId>
        <version>${protobuf.version}</version>
      </dependency>
      <dependency>
        <groupId>io.airlift</groupId>
        <artifactId>aircompressor</artifactId>
        <version>${aircompressor.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-compress</artifactId>
        <version>${commons-compress.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.ivy</groupId>
        <artifactId>ivy</artifactId>
        <version>${ivy.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.zookeeper</groupId>
        <artifactId>zookeeper</artifactId>
        <version>${zookeeper.version}</version>
      </dependency>
      <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-library</artifactId>
        <version>${scala.version}</version>
      </dependency>
      <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-reflect</artifactId>
        <version>${scala.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-core_${scala.binary.version}</artifactId>
    </dependency>

    <dependency>
      <groupId>io.zipkin.zipkin2</groupId>
      <artifactId>zipkin</artifactId>
      <version>${zipkin.version}</version>
    </dependency>

    <!-- avoids compile error: Could not access type DataFrame in package org.apache.spark.sql -->
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-sql_${scala.binary.version}</artifactId>
      <version>${spark.version}</version>
    </dependency>

    <dependency>
      <groupId>io.zipkin.zipkin2</groupId>
      <artifactId>zipkin-tests</artifactId>
      <version>${zipkin.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>${junit-jupiter.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>${assertj.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <!-- mvn de.qaware.maven:go-offline-maven-plugin:resolve-dependencies -->
        <plugin>
          <groupId>de.qaware.maven</groupId>
          <artifactId>go-offline-maven-plugin</artifactId>
          <version>${go-offline-maven-plugin.version}</version>
          <configuration>
            <!-- Add dependencies indirectly referenced by build plugins -->
            <dynamicDependencies>
              <DynamicDependency>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin-git</artifactId>
                <version>${license-maven-plugin.version}</version>
                <repositoryType>MAIN</repositoryType>
              </DynamicDependency>
              <DynamicDependency>
                <groupId>com.google.errorprone</groupId>
                <artifactId>error_prone_core</artifactId>
                <version>${errorprone.version}</version>
                <repositoryType>MAIN</repositoryType>
              </DynamicDependency>
              <DynamicDependency>
                <groupId>org.apache.maven.surefire</groupId>
                <artifactId>surefire-junit-platform</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <repositoryType>PLUGIN</repositoryType>
              </DynamicDependency>
            </dynamicDependencies>
          </configuration>
        </plugin>

        <!-- Uploads occur as a last step (which also adds checksums) -->
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${maven-deploy-plugin.version}</version>
        </plugin>

        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>${maven-install-plugin.version}</version>
        </plugin>

        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${maven-jar-plugin.version}</version>
          <configuration>
            <archive>
              <!-- prevents huge pom file from also being added to the jar under META-INF/maven -->
              <addMavenDescriptor>false</addMavenDescriptor>
            </archive>
          </configuration>
        </plugin>

        <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <version>${maven-release-plugin.version}</version>
          <configuration>
            <useReleaseProfile>false</useReleaseProfile>
            <releaseProfiles>release</releaseProfiles>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <tagNameFormat>@{project.version}</tagNameFormat>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.sonatype.central</groupId>
          <artifactId>central-publishing-maven-plugin</artifactId>
          <version>${central-publishing-maven-plugin.version}</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>flatten-maven-plugin</artifactId>
          <version>${flatten-maven-plugin.version}</version>
        </plugin>

        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven-compiler-plugin.version}</version>
          <inherited>true</inherited>
          <configuration>
            <fork>true</fork>
            <showWarnings>true</showWarnings>
          </configuration>
          <executions>
            <execution>
              <!-- only use errorprone on main source tree -->
              <id>default-compile</id>
              <phase>compile</phase>
              <goals>
                <goal>compile</goal>
              </goals>
              <configuration>
                <forceJavacCompilerUse>true</forceJavacCompilerUse>
                <compilerArgs>
                  <arg>-XDcompilePolicy=simple</arg>
                  <arg>--should-stop=ifError=FLOW</arg>
                  <arg>-Xplugin:ErrorProne ${errorprone.args}</arg>
                  <!-- below needed per https://errorprone.info/docs/installation -->
                  <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
                  <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
                  <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
                  <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
                  <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
                  <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
                  <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
                  <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
                  <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
                  <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
                </compilerArgs>
                <annotationProcessorPaths>
                  <processorPath>
                    <groupId>com.google.errorprone</groupId>
                    <artifactId>error_prone_core</artifactId>
                    <version>${errorprone.version}</version>
                  </processorPath>
                </annotationProcessorPaths>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <!-- Ensure common utility commands use coherent versions (avoid lazy downloads) -->
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>${maven-dependency-plugin.version}</version>
      </plugin>
      <plugin>
        <artifactId>maven-help-plugin</artifactId>
        <version>${maven-help-plugin.version}</version>
      </plugin>

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
        <configuration>
          <argLine>${maven.test.argLine}</argLine>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
        <executions>
          <execution>
            <id>integration-test</id>
            <phase>verify</phase>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <argLine>${maven.test.argLine}</argLine>
          <!-- Try to prevent flakes in CI -->
          <reuseForks>false</reuseForks>
          <!-- workaround to SUREFIRE-1831 -->
          <useModulePath>false</useModulePath>
          <!-- Ensures root cause ends up in the console -->
          <trimStackTrace>false</trimStackTrace>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>${maven-enforcer-plugin.version}</version>
        <executions>
          <execution>
            <id>enforce-java</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <!-- Change this to control LTS JDK versions allowed to build
                       the project. Keep in sync with .github/workflows -->
                  <!-- Note: JDK 17 until Spark 4 per SPARK-43831 -->
                  <version>[17,18)</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>${license-maven-plugin.version}</version>
        <configuration>
          <skip>${license.skip}</skip>
          <header>${main.basedir}/src/etc/header.txt</header>
          <mapping>
            <!-- Don't use javadoc style as this makes code formatters break it by adding tags! -->
            <java>SLASHSTAR_STYLE</java>
            <!-- build-bin/docker -->
            <configure_docker>SCRIPT_STYLE</configure_docker>
            <configure_docker_push>SCRIPT_STYLE</configure_docker_push>
            <docker_arch>SCRIPT_STYLE</docker_arch>
            <docker_args>SCRIPT_STYLE</docker_args>
            <docker_block_on_health>SCRIPT_STYLE</docker_block_on_health>
            <docker_build>SCRIPT_STYLE</docker_build>
            <docker_push>SCRIPT_STYLE</docker_push>
            <docker_test_image>SCRIPT_STYLE</docker_test_image>
            <!-- build-bin/git -->
            <login_git>SCRIPT_STYLE</login_git>
            <version_from_trigger_tag>SCRIPT_STYLE</version_from_trigger_tag>
            <!-- build-bin/gpg -->
            <configure_gpg>SCRIPT_STYLE</configure_gpg>
            <!-- build-bin/maven -->
            <maven_build>SCRIPT_STYLE</maven_build>
            <maven_build_or_unjar>SCRIPT_STYLE</maven_build_or_unjar>
            <maven_deploy>SCRIPT_STYLE</maven_deploy>
            <maven_go_offline>SCRIPT_STYLE</maven_go_offline>
            <maven_release>SCRIPT_STYLE</maven_release>
            <maven_opts>SCRIPT_STYLE</maven_opts>
            <maven_unjar>SCRIPT_STYLE</maven_unjar>
            <!-- docker/periodic/** -->
            <zipkin-dependencies-today>SCRIPT_STYLE</zipkin-dependencies-today>
            <zipkin-dependencies-yesterday>SCRIPT_STYLE</zipkin-dependencies-yesterday>
            <!-- docker/bin -->
            <start-zipkin-dependencies>SCRIPT_STYLE</start-zipkin-dependencies>
          </mapping>
          <excludes>
            <exclude>.docker.env</exclude>
            <exclude>.gitignore</exclude>
            <exclude>.editorconfig</exclude>
            <exclude>.mvn/**</exclude>
            <exclude>mvnw*</exclude>
            <exclude>etc/header.txt</exclude>
            <exclude>**/.idea/**</exclude>
            <exclude>LICENSE</exclude>
            <exclude>**/*.md</exclude>
            <exclude>src/test/resources/**</exclude>
            <exclude>src/main/resources/**</exclude>
            <exclude>.dockerignore</exclude>
            <exclude>build-bin/*</exclude>
          </excludes>
          <strictCheck>true</strictCheck>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin-git</artifactId>
            <version>${license-maven-plugin.version}</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>compile</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>

    <resources>
      <!-- This adds the LICENSE and NOTICE file to the jar and -sources jar of each module -->
      <resource>
        <filtering>false</filtering>
        <directory>${main.basedir}</directory>
        <targetPath>META-INF/</targetPath>
        <includes>
          <include>LICENSE</include>
          <include>NOTICE</include>
        </includes>
      </resource>
    </resources>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>flatten-maven-plugin</artifactId>
            <configuration>
              <flattenMode>ossrh</flattenMode>
            </configuration>
            <executions>
              <execution>
                <id>flatten</id>
                <phase>process-resources</phase>
                <goals>
                  <goal>flatten</goal>
                </goals>
              </execution>
              <execution>
                <id>flatten.clean</id>
                <phase>clean</phase>
                <goals>
                  <goal>clean</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
              <autoPublish>true</autoPublish>
            </configuration>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.8</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>

          <!-- Creates source jar -->
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>${maven-source-plugin.version}</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- Creates javadoc jar, skipping internal classes -->
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${maven-javadoc-plugin.version}</version>
            <configuration>
              <sourceFileExcludes>
                <exclude>**/internal/*.java</exclude>
                <exclude>**/Internal*.java</exclude>
              </sourceFileExcludes>
              <excludePackageNames>*.internal.*</excludePackageNames>
              <failOnError>false</failOnError>
              <!-- hush pedantic warnings: we don't put param and return on everything! -->
              <doclint>none</doclint>
              <!-- While we publish modules, our source is pre-Java9 so tell javadoc that. -->
              <source>8</source>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <phase>package</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
