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

    Copyright (c) 2019 - 2024 StreamNative, Inc.. All Rights Reserved.

-->
<!--

    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.

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

  <parent>
    <groupId>org.apache</groupId>
    <artifactId>apache</artifactId>
    <version>18</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <packaging>pom</packaging>

  <groupId>io.streamnative.pulsar.handlers</groupId>
  <artifactId>pulsar-protocol-handler-kafka-parent</artifactId>
  <version>4.2.0.9</version>
  <name>StreamNative :: Pulsar Protocol Handler :: KoP Parent</name>
  <description>Parent for Kafka on Pulsar implemented using Pulsar Protocol Handler.</description>
  <url>https://github.com/streamnative/ksn</url>

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

  <scm>
    <url>https://github.com/streamnative/ksn</url>
    <connection>scm:git:https://github.com/streamnative/ksn.git</connection>
    <developerConnection>scm:git:https://github.com/streamnative/ksn.git</developerConnection>
  </scm>

  <developers>
    <developer>
      <organization>StreamNative</organization>
      <organizationUrl>https://streamnative.io/</organizationUrl>
    </developer>
  </developers>

  <properties>
    <javac.target>17</javac.target>
    <redirectTestOutputToFile>true</redirectTestOutputToFile>
    <!-- required for running tests on JDK11+ -->
    <test.additional.args>
      --add-opens java.base/jdk.internal.loader=ALL-UNNAMED
      --add-opens java.base/java.lang=ALL-UNNAMED <!--Mockito-->
      --add-opens java.base/java.io=ALL-UNNAMED <!--Bookkeeper NativeIO-->
      --add-opens java.base/java.util=ALL-UNNAMED <!--System Lambda-->
      --add-opens java.base/sun.net=ALL-UNNAMED <!--netty.DnsResolverUtil-->
      --add-opens java.management/sun.management=ALL-UNNAMED <!--JvmDefaultGCMetricsLogger-->
    </test.additional.args>
    <!-- dependencies -->
    <jackson-databind.version>2.18.6</jackson-databind.version>
    <kafka.version>3.9.1</kafka.version>
    <!-- Confluent Platform (incl. Schema Registry) version 7.9.x is compatible with Apache Kafka 3.9.x -->
    <schema.registry.version>7.9.4</schema.registry.version>
    <lombok.version>1.18.24</lombok.version>
    <mockito.version>4.11.0</mockito.version>
    <wiremock.version>3.0.0-beta-2</wiremock.version>
    <pulsar.group.id>io.streamnative</pulsar.group.id>
    <pulsar.version>4.2.0.9</pulsar.version>
    <sn.bom.version>4.2.0.9</sn.bom.version>
    <rbac.version>1.7.4</rbac.version>
    <slf4j.version>2.0.13</slf4j.version>
    <log4j2.version>2.23.1</log4j2.version>
    <spotbugs-annotations.version>4.9.8</spotbugs-annotations.version>
    <apicurio.version>2.5.11.Final</apicurio.version>
    <testng.version>7.0.0</testng.version>
    <awaitility.version>4.0.3</awaitility.version>
    <grpc.version>1.56.1</grpc.version>
    <junit.version>4.13.1</junit.version>
    <fusionauth-jwt.version>5.2.1</fusionauth-jwt.version>
    <snakeyaml.version>1.32</snakeyaml.version>
    <zstd-jni.version>1.5.2-4</zstd-jni.version>
    <client.plugin.compiler.release>8</client.plugin.compiler.release>
    <maven-enforcer-plugin.version>3.3.0</maven-enforcer-plugin.version>
    <extra-enforcer-rules.version>1.6.1</extra-enforcer-rules.version>
    <oxia.version>0.6.0</oxia.version>
    <prometheus.version>0.16.0</prometheus.version>
    <apicurio.version>2.5.11.Final</apicurio.version>
    <io.swagger.core.v3.version>2.2.30</io.swagger.core.v3.version>
    <jersey-media-sse.version>2.42</jersey-media-sse.version>
    <com.squareup.okhttp3.version>5.3.1</com.squareup.okhttp3.version>
    <opentelemetry.version>1.56.0</opentelemetry.version>
    <avro.version>1.12.0</avro.version>
    <commons-lang.version>2.6</commons-lang.version>
    <testcontainers.version>1.21.4</testcontainers.version>
    <!-- Set docker-java.version to the version of docker-java used in org.testcontainers:testcontainers pom -->
    <docker-java.version>3.7.0</docker-java.version>

    <!-- plugin dependencies -->
    <license-maven-plugin.version>3.0.rc1</license-maven-plugin.version>
    <maven-checkstyle-plugin.version>3.1.1</maven-checkstyle-plugin.version>
    <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
    <maven-javadoc-plugin.version>3.4.1</maven-javadoc-plugin.version>
    <maven-shade-plugin.version>3.4.1</maven-shade-plugin.version>
    <maven-surefire-plugin.version>3.0.0-M3</maven-surefire-plugin.version>
    <puppycrawl.checkstyle.version>10.12.4</puppycrawl.checkstyle.version>
    <spotbugs-maven-plugin.version>4.9.8.1</spotbugs-maven-plugin.version>
    <maven-central-plugin.version>0.7.0</maven-central-plugin.version>
    <maven-jacoco-plugin.version>0.8.8</maven-jacoco-plugin.version>
    <kaml.version>0.53.0</kaml.version>
    <kotlinx-serialization-core.version>1.5.0</kotlinx-serialization-core.version>
    <kotlin.version>1.8.10</kotlin.version>
    <org-json.version>20230227</org-json.version>
  </properties>

  <modules>
    <module>kafka-0-9</module>
    <module>kafka-0-10</module>
    <module>kafka-1-0</module>
    <module>kafka-2-8</module>
    <module>kafka-3-0</module>
    <module>kafka-client-api</module>
    <module>kafka-client-factory</module>
    <module>schema-registry</module>
    <module>kafka-impl</module>
    <module>oauth-client</module>
    <module>oauth-client-shaded</module>
    <module>oauth-client-shaded-test</module>
    <module>kafka-payload-processor</module>
    <module>kafka-payload-processor-shaded</module>
    <module>kafka-payload-processor-shaded-tests</module>
    <module>test-listener</module>
    <module>shadow-namespace-load-manager</module>
    <module>integration-tests</module>
    <module>tests-common</module>
    <module>schema-registry-distribution</module>
    <module>kafka-rest-servlet</module>
    <module>kafka-common</module>
    <module>smoke-tests</module>
    <module>tests</module>
  </modules>

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

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

      <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-bom</artifactId>
        <version>${log4j2.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>io.streamnative.pulsar</groupId>
        <artifactId>unified-rbac-sdk-java-pulsar</artifactId>
        <version>${rbac.version}</version>
      </dependency>

      <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-all</artifactId>
        <version>${grpc.version}</version>
        <scope>provided</scope>
      </dependency>

      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <scope>provided</scope>
      </dependency>

      <dependency>
        <groupId>io.streamnative</groupId>
        <artifactId>pulsar-broker</artifactId>
        <version>${pulsar.version}</version>
        <type>test-jar</type>
      </dependency>

      <dependency>
        <groupId>io.streamnative</groupId>
        <artifactId>pulsar-client-auth-sasl</artifactId>
        <version>${pulsar.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>io.streamnative</groupId>
        <artifactId>managed-ledger</artifactId>
        <type>test-jar</type>
        <version>${pulsar.version}</version>
      </dependency>

      <dependency>
        <groupId>io.streamnative</groupId>
        <artifactId>testmocks</artifactId>
        <version>${pulsar.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>${testng.version}</version>
      </dependency>

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

      <dependency>
        <groupId>com.github.tomakehurst</groupId>
        <artifactId>wiremock</artifactId>
        <version>${wiremock.version}</version>
        <scope>test</scope>
        <exclusions>
          <exclusion>
            <artifactId>jackson-core</artifactId>
            <groupId>com.fasterxml.jackson.core</groupId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-inline</artifactId>
        <scope>test</scope>
        <version>${mockito.version}</version>
      </dependency>

      <dependency>
        <groupId>org.awaitility</groupId>
        <artifactId>awaitility</artifactId>
        <scope>test</scope>
        <version>${awaitility.version}</version>
      </dependency>

      <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>testcontainers-bom</artifactId>
        <version>${testcontainers.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>com.github.docker-java</groupId>
        <artifactId>docker-java-bom</artifactId>
        <version>${docker-java.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>io.fusionauth</groupId>
        <artifactId>fusionauth-jwt</artifactId>
        <scope>test</scope>
        <version>${fusionauth-jwt.version}</version>
      </dependency>

      <dependency>
        <groupId>io.streamnative.pulsar.handlers</groupId>
        <artifactId>test-listener</artifactId>
        <scope>test</scope>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>io.prometheus</groupId>
        <artifactId>simpleclient</artifactId>
        <version>${prometheus.version}</version>
      </dependency>

      <dependency>
        <groupId>io.prometheus</groupId>
        <artifactId>simpleclient_hotspot</artifactId>
        <version>${prometheus.version}</version>
      </dependency>

      <dependency>
        <groupId>io.prometheus</groupId>
        <artifactId>simpleclient_log4j2</artifactId>
        <version>${prometheus.version}</version>
      </dependency>

      <dependency>
        <groupId>io.prometheus</groupId>
        <artifactId>simpleclient_servlet</artifactId>
        <version>${prometheus.version}</version>
      </dependency>

      <dependency>
        <groupId>io.prometheus</groupId>
        <artifactId>simpleclient_jetty</artifactId>
        <version>${prometheus.version}</version>
      </dependency>

      <dependency>
        <groupId>io.prometheus</groupId>
        <artifactId>simpleclient_caffeine</artifactId>
        <version>${prometheus.version}</version>
      </dependency>

      <dependency>
        <groupId>io.apicurio</groupId>
        <artifactId>apicurio-registry-schema-util-protobuf</artifactId>
        <version>${apicurio.version}</version>
      </dependency>

      <dependency>
        <groupId>io.apicurio</groupId>
        <artifactId>apicurio-registry-schema-util-json</artifactId>
        <version>${apicurio.version}</version>
      </dependency>

      <dependency>
        <groupId>io.apicurio</groupId>
        <artifactId>apicurio-registry-schema-util-avro</artifactId>
        <version>${apicurio.version}</version>
      </dependency>

      <dependency>
        <groupId>io.confluent</groupId>
        <artifactId>kafka-schema-serializer</artifactId>
        <version>${schema.registry.version}</version>
      </dependency>

      <dependency>
        <groupId>io.confluent</groupId>
        <artifactId>kafka-schema-registry-client</artifactId>
        <version>${schema.registry.version}</version>
      </dependency>

      <dependency>
        <groupId>io.confluent</groupId>
        <artifactId>kafka-avro-serializer</artifactId>
        <version>${schema.registry.version}</version>
      </dependency>

      <dependency>
        <groupId>io.confluent</groupId>
        <artifactId>kafka-json-schema-serializer</artifactId>
        <version>${schema.registry.version}</version>
      </dependency>

      <dependency>
        <groupId>io.confluent</groupId>
        <artifactId>kafka-protobuf-serializer</artifactId>
        <version>${schema.registry.version}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.avro</groupId>
        <artifactId>avro</artifactId>
        <version>${avro.version}</version>
      </dependency>

      <dependency>
        <groupId>org.json</groupId>
        <artifactId>json</artifactId>
        <version>20250517</version>
      </dependency>

      <dependency>
        <groupId>com.github.erosb</groupId>
        <artifactId>everit-json-schema</artifactId>
        <version>1.14.6</version>
      </dependency>

      <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java</artifactId>
        <version>3.25.5</version>
      </dependency>

      <dependency>
        <groupId>com.squareup.wire</groupId>
        <artifactId>wire-schema-jvm</artifactId>
        <version>5.2.0</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.datatype</groupId>
        <artifactId>jackson-datatype-guava</artifactId>
        <version>${jackson-databind.version}</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.datatype</groupId>
        <artifactId>jackson-datatype-joda</artifactId>
        <version>${jackson-databind.version}</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.dataformat</groupId>
        <artifactId>jackson-dataformat-yaml</artifactId>
        <version>${jackson-databind.version}</version>
      </dependency>

      <!-- Align Kafka server version used in tests -->
      <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka_2.13</artifactId>
        <version>${kafka.version}</version>
      </dependency>

      <!-- For integration tests that do not depend on kafka-impl dependency -->
      <dependency>
        <groupId>io.opentelemetry</groupId>
        <artifactId>opentelemetry-sdk-extension-autoconfigure-spi</artifactId>
        <version>${opentelemetry.version}</version>
      </dependency>
      <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>${commons-lang.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>${maven-checkstyle-plugin.version}</version>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>${puppycrawl.checkstyle.version}</version>
            </dependency>
          </dependencies>
          <configuration>
            <configLocation>resources/checkstyle.xml</configLocation>
            <suppressionsLocation>resources/suppressions.xml</suppressionsLocation>
            <encoding>UTF-8</encoding>
            <consoleOutput>true</consoleOutput>
            <failOnViolation>true</failOnViolation>
            <includeResources>false</includeResources>
            <includeTestSourceDirectory>true</includeTestSourceDirectory>
          </configuration>
          <executions>
            <execution>
              <id>checkstyle</id>
              <phase>validate</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${maven-javadoc-plugin.version}</version>
        <configuration>
          <source>17</source>
          <doclint>none</doclint>
        </configuration>
      </plugin>

      <plugin>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-maven-plugin</artifactId>
        <version>${spotbugs-maven-plugin.version}</version>
        <configuration>
          <excludeFilterFile>resources/findbugsExclude.xml</excludeFilterFile>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven-compiler-plugin.version}</version>
        <configuration>
          <source>${javac.target}</source>
          <target>${javac.target}</target>
          <compilerArgs>
            <!--
            <compilerArg>-Werror</compilerArg>
            -->
            <compilerArg>-Xlint:deprecation</compilerArg>
            <compilerArg>-Xlint:unchecked</compilerArg>
            <!-- https://issues.apache.org/jira/browse/MCOMPILER-205 -->
            <compilerArg>-Xpkginfo:always</compilerArg>
          </compilerArgs>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
        <configuration>
          <argLine>@{argLine} -Xmx2G
            -Dpulsar.allocator.pooled=false
            -Dpulsar.allocator.leak_detection=Advanced
            -Dlog4j.configurationFile="log4j2.xml"
            -Dproject.root="${project.basedir}"
            ${test.additional.args}
          </argLine>
          <reuseForks>false</reuseForks>
          <forkCount>1</forkCount>
          <redirectTestOutputToFile>${redirectTestOutputToFile}</redirectTestOutputToFile>
          <trimStackTrace>false</trimStackTrace>
          <properties>
            <property>
              <name>usedefaultlisteners</name>
              <value>false</value> <!-- disabling default listeners is optional -->
            </property>
            <property>
              <name>listener</name>
              <value>io.streamnative.pulsar.handlers.kop.common.test.TimeOutTestListener</value>
            </property>
          </properties>
        </configuration>
      </plugin>

      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>${license-maven-plugin.version}</version>
        <configuration>
          <header>LICENSE</header>

          <excludes>
            <exclude>LICENSE</exclude>
            <exclude>NOTICE</exclude>
            <exclude>Jenkinsfile</exclude>
            <exclude>**/build/**</exclude>
            <exclude>**/ahc.properties</exclude>
            <exclude>**/.idea/**</exclude>
            <exclude>**/.github/**</exclude>
            <exclude>**/conf/**</exclude>
            <exclude>**/bin/**</exclude>
            <exclude>**/swagger/**</exclude>
          </excludes>
          <mapping>
            <proto>JAVADOC_STYLE</proto>
            <go>DOUBLESLASH_STYLE</go>
            <conf>SCRIPT_STYLE</conf>
            <ini>SCRIPT_STYLE</ini>
            <yaml>SCRIPT_STYLE</yaml>
            <tf>SCRIPT_STYLE</tf>
            <cfg>SCRIPT_STYLE</cfg>
            <Makefile>SCRIPT_STYLE</Makefile>
            <service>SCRIPT_STYLE</service>
            <cc>JAVADOC_STYLE</cc>
            <md>XML_STYLE</md>
            <txt>SCRIPT_STYLE</txt>
            <scss>JAVADOC_STYLE</scss>
            <Doxyfile>SCRIPT_STYLE</Doxyfile>
            <tfvars>SCRIPT_STYLE</tfvars>
            <kop>SCRIPT_STYLE</kop>
          </mapping>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>templating-maven-plugin</artifactId>
        <version>1.0.0</version>
        <executions>
          <execution>
            <id>filtering-java-templates</id>
            <goals>
              <goal>filter-sources</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>pl.project13.maven</groupId>
        <artifactId>git-commit-id-plugin</artifactId>
        <version>4.0.0</version>
        <executions>
          <execution>
            <id>get-the-git-infos</id>
            <goals>
              <goal>revision</goal>
            </goals>
            <phase>initialize</phase>
          </execution>
        </executions>
        <configuration>
          <generateGitPropertiesFile>true</generateGitPropertiesFile>
          <generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
          <includeOnlyProperties>
            <includeOnlyProperty>^git.build.(host|time|version)$</includeOnlyProperty>
            <includeOnlyProperty>^git.commit.id.(abbrev|full)$</includeOnlyProperty>
            <includeOnlyProperty>^git.dirty$</includeOnlyProperty>
            <includeOnlyProperty>^git.build.user.(email|name)$</includeOnlyProperty>
          </includeOnlyProperties>
          <commitIdGenerationMode>full</commitIdGenerationMode>
          <!-- A workaround to make build work in a Git worktree, see https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/215 -->
          <useNativeGit>true</useNativeGit>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${maven-jacoco-plugin.version}</version>
        <configuration>
          <includes>
            <include>**/pulsar/handlers/**</include>
          </includes>
        </configuration>
        <executions>
          <execution>
            <id>pre-test</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>post-test</id>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <repositories>
    <repository>
      <id>central</id>
      <layout>default</layout>
      <url>https://repo1.maven.org/maven2</url>
    </repository>
    <!-- maven-central-direct is intentionally not named "central" so that it bypasses
         the google-maven-central mirror configured in CI settings.xml (mirrorOf=central).
         This ensures artifacts not yet synced to the Google mirror (e.g. slog) can still
         be resolved directly from Maven Central. -->
    <repository>
      <id>maven-central-direct</id>
      <url>https://repo1.maven.org/maven2</url>
    </repository>
    <repository>
      <id>github</id>
      <url>https://maven.pkg.github.com/streamnative/*</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>confluent</id>
      <url>https://packages.confluent.io/maven/</url>
    </repository>
  </repositories>

  <profiles>
    <profile>
      <id>github-deploy</id>
      <distributionManagement>
        <repository>
          <id>github</id>
          <name>GitHub Packages</name>
          <url>https://maven.pkg.github.com/streamnative/pulsar</url>
        </repository>
        <snapshotRepository>
          <id>github</id>
          <name>GitHub Packages</name>
          <url>https://maven.pkg.github.com/streamnative/pulsar</url>
        </snapshotRepository>
      </distributionManagement>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${maven-javadoc-plugin.version}</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <source>17</source>
              <doclint>none</doclint>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <!-- Prevent `gpg` from using pinentry programs -->
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>${maven-central-plugin.version}</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
              <autoPublish>true</autoPublish>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
