<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2021 Flyte Authors.

  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">
  <modelVersion>4.0.0</modelVersion>

  <groupId>org.flyte</groupId>
  <artifactId>flytekit-parent</artifactId>
  <version>0.4.21</version>

  <packaging>pom</packaging>

  <name>Flytekit Java</name>
  <description>Flytekit Java is the Java/Scala SDK built on top of Flyte.</description>
  <url>https://github.com/flyteorg/flytekit-java</url>

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

  <developers>
    <developer>
      <name>flytekit</name>
      <email>admin@flyte.org</email>
      <organization>Flyte</organization>
      <organizationUrl>https://flyte.org</organizationUrl>
    </developer>
  </developers>

  <modules>
    <module>flytekit-api</module>
    <module>flytekit-jackson</module>
    <module>flytekit-java</module>
    <module>flytekit-scala_2.12</module>
    <module>flytekit-scala_2.13</module>
    <module>flytekit-scala-tests</module>
    <module>flytekit-testing</module>
    <module>flytekit-examples</module>
    <module>flytekit-examples-scala</module>
    <module>flytekit-local-engine</module>
    <module>flyteidl-protos</module>
    <module>jflyte-api</module>
    <module>jflyte-aws</module>
    <module>jflyte-google-cloud</module>
    <module>jflyte</module>
    <module>integration-tests</module>
  </modules>

  <scm>
    <connection>scm:git:https://github.com/flyteorg/flytekit-java.git</connection>
    <developerConnection>scm:git:https://github.com/flyteorg/flytekit-java.git</developerConnection>
    <tag>0.4.21</tag>
    <url>https://github.com/flyteorg/flytekit-java</url>
  </scm>

  <distributionManagement>
    <repository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <properties>
    <auto-service.version>1.0.1</auto-service.version>
    <auto-value.version>1.10.1</auto-value.version>
    <common-proto.version>2.14.3</common-proto.version>
    <grpc.version>1.46.0</grpc.version>
    <!-- must be aligned with netty version -->
    <!-- see: https://github.com/grpc/grpc-java/blob/master/SECURITY.md#netty -->
    <netty.tcnative.version>2.0.52.Final</netty.tcnative.version>
    <picocli.version>4.7.2</picocli.version>
    <protobuf.version>3.21.12</protobuf.version>
    <sl4j.version>1.7.36</sl4j.version>
    <spotless.version>2.21.0</spotless.version>
    <spotbugs.excludeFilterFile>spotbugs-exclude.xml</spotbugs.excludeFilterFile>
    <error_prone.version>2.19.1</error_prone.version>
    <!-- Using the error-prone-javac is required when running on JDK 8 -->
    <error_prone.javac.version>9+181-r4173-1</error_prone.javac.version>
    <junit.version>5.6.2</junit.version>

    <!-- has to be one liner, or errorprone doesn't work -->
    <error-prone-base-config><![CDATA[-Xplugin:ErrorProne -XepDisableWarningsInGeneratedCode -XepExcludedPaths:.*/generated-(test-)?sources/.*]]></error-prone-base-config>
    <error-prone-additional-args>-Xep:AutoValueImmutableFields:OFF -Xep:Var:ERROR</error-prone-additional-args>

    <maven.compiler.release>11</maven.compiler.release>
    <maven.compiler.source>${maven.compiler.release}</maven.compiler.source>
    <maven.compiler.target>${maven.compiler.release}</maven.compiler.target>
    <mockito.version>3.3.3</mockito.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <!-- modules -->
      <dependency>
        <groupId>org.flyte</groupId>
        <artifactId>flyteidl-protos</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.flyte</groupId>
        <artifactId>flytekit-api</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.flyte</groupId>
        <artifactId>flytekit-jackson</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.flyte</groupId>
        <artifactId>flytekit-java</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.flyte</groupId>
        <artifactId>flytekit-local-engine</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.flyte</groupId>
        <artifactId>flytekit-scala_2.12</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.flyte</groupId>
        <artifactId>flytekit-scala_2.13</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.flyte</groupId>
        <artifactId>flytekit-testing</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.flyte</groupId>
        <artifactId>flytekit-examples</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.flyte</groupId>
        <artifactId>flytekit-examples-scala</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.flyte</groupId>
        <artifactId>jflyte-api</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.flyte</groupId>
        <artifactId>jflyte</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.flyte</groupId>
        <artifactId>jflyte-aws</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.flyte</groupId>
        <artifactId>jflyte-build</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.flyte</groupId>
        <artifactId>jflyte-google-cloud</artifactId>
        <version>${project.version}</version>
      </dependency>

      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>31.1-jre</version>
      </dependency>
      <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-bom</artifactId>
        <version>${grpc.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-tcnative-boringssl-static</artifactId>
        <version>${netty.tcnative.version}</version>
      </dependency>
      <dependency>
        <groupId>com.google.code.findbugs</groupId>
        <artifactId>jsr305</artifactId>
        <version>3.0.2</version>
      </dependency>
      <dependency>
        <groupId>com.google.errorprone</groupId>
        <artifactId>error_prone_annotations</artifactId>
        <version>${error_prone.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${sl4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>${sl4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jul-to-slf4j</artifactId>
        <version>${sl4j.version}</version>
      </dependency>
      <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java</artifactId>
        <version>${protobuf.version}</version>
      </dependency>
      <dependency>
        <groupId>com.google.api.grpc</groupId>
        <artifactId>proto-google-common-protos</artifactId>
        <version>${common-proto.version}</version>
      </dependency>
      <dependency>
        <groupId>com.google.auto.value</groupId>
        <artifactId>auto-value-annotations</artifactId>
        <version>${auto-value.version}</version>
      </dependency>
      <dependency>
        <groupId>com.google.auto.service</groupId>
        <artifactId>auto-service-annotations</artifactId>
        <version>${auto-service.version}</version>
      </dependency>
      <dependency>
        <groupId>info.picocli</groupId>
        <artifactId>picocli</artifactId>
        <version>${picocli.version}</version>
      </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter</artifactId>
        <version>${junit.version}</version>
      </dependency>
      <dependency>
        <groupId>org.junit.vintage</groupId>
        <artifactId>junit-vintage-engine</artifactId>
        <version>${junit.version}</version>
      </dependency>
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest</artifactId>
        <version>2.2</version>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${mockito.version}</version>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-junit-jupiter</artifactId>
        <version>${mockito.version}</version>
      </dependency>
      <dependency>
        <groupId>com.github.marschall</groupId>
        <artifactId>memoryfilesystem</artifactId>
        <version>2.3.0</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.2</version>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.5.13</version>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.2.3</version>
      </dependency>
      <dependency>
        <groupId>javax.annotation</groupId>
        <artifactId>javax.annotation-api</artifactId>
        <version>1.3.2</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson</groupId>
        <artifactId>jackson-bom</artifactId>
        <version>2.14.2</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>libraries-bom</artifactId>
        <version>25.4.0</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk-bom</artifactId>
        <version>1.12.486</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <repositories>
    <repository>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <id>apache.snapshots</id>
      <name>Apache Development Snapshot Repository</name>
      <url>https://repository.apache.org/content/repositories/snapshots/</url>
    </repository>
    <repository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>ossrh</id>
      <name>Sonatype OSS</name>
      <url>https://oss.sonatype.org/content/repositories/releases/</url>
    </repository>
  </repositories>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.1</version>
          <configuration>
            <showWarnings>true</showWarnings>
            <showDeprecation>true</showDeprecation>
            <forceJavacCompilerUse>true</forceJavacCompilerUse>
            <failOnWarning>true</failOnWarning>
            <!-- The semantics of this option are reversed, see MCOMPILER-209. -->
            <useIncrementalCompilation>false</useIncrementalCompilation>
            <encoding>utf-8</encoding>
            <compilerArgs>
              <!-- for AutoValue reflection -->
              <arg>-parameters</arg>
              <arg>-Xlint:all</arg>
              <!-- disable not helpful warnings to fail on warnings -->
              <arg>-Xlint:-path</arg>
              <arg>-Xlint:-processing</arg>
              <!-- we don't care about classes being deserialized with different classpath -->
              <arg>-Xlint:-serial</arg>
              <arg>-implicit:class</arg>
              <!-- see https://stackoverflow.com/a/57004351 -->
              <arg>-Xpkginfo:always</arg>
            </compilerArgs>
            <annotationProcessorPaths>
              <path>
                <groupId>com.google.auto.value</groupId>
                <artifactId>auto-value</artifactId>
                <version>${auto-value.version}</version>
              </path>
              <path>
                <groupId>com.google.auto.service</groupId>
                <artifactId>auto-service</artifactId>
                <version>${auto-service.version}</version>
              </path>
              <path>
                <groupId>com.google.errorprone</groupId>
                <artifactId>error_prone_core</artifactId>
                <version>${error_prone.version}</version>
              </path>
            </annotationProcessorPaths>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.2</version>
        </plugin>
        <plugin>
          <groupId>com.diffplug.spotless</groupId>
          <artifactId>spotless-maven-plugin</artifactId>
          <version>${spotless.version}</version>
          <configuration>
            <java>
              <licenseHeader>
                <!-- Specify either content or file, but not both -->
                <content><![CDATA[/*
 * Copyright 2021 Flyte Authors
 *
 * 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.
 */]]></content>
              </licenseHeader>
              <googleJavaFormat>
                <version>1.8</version>
                <style>GOOGLE</style>
              </googleJavaFormat>
              <removeUnusedImports />
            </java>
            <xml>
              <includes>
                <include>**/pom.xml</include>
                <include>**/src/**/*.xml</include>
              </includes>
              <licenseHeader>
                <content><![CDATA[<!--
  Copyright 2021 Flyte Authors.

  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.
-->]]></content>
              </licenseHeader>
              <eclipse>
                <file>${maven.multiModuleProjectDirectory}/spotless.xmlformat.prefs</file>
              </eclipse>
            </xml>
            <scala>
              <scalafmt>
                <file>${maven.multiModuleProjectDirectory}/.scalafmt.conf</file>
              </scalafmt>
              <licenseHeader>
                <content><![CDATA[/*
 * Copyright 2021 Flyte Authors.
 *
 * 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.
 */]]></content>
              </licenseHeader>
            </scala>
            <pom>
              <!-- These are the defaults, you can override if you want -->
              <includes>
                <include>pom.xml</include>
              </includes>

              <sortPom>
                <encoding>UTF-8</encoding>
                <lineSeparator>${line.separator}</lineSeparator>
                <expandEmptyElements>false</expandEmptyElements>
                <spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement>
                <keepBlankLines>true</keepBlankLines>
                <nrOfIndentSpace>2</nrOfIndentSpace>
                <indentBlankLines>false</indentBlankLines>
                <indentSchemaLocation>false</indentSchemaLocation>
                <predefinedSortOrder>recommended_2008_06</predefinedSortOrder>
                <sortProperties>false</sortProperties>
                <sortModules>false</sortModules>
                <sortExecutions>false</sortExecutions>
              </sortPom>
            </pom>

            <formats>
              <format>
                <includes>
                  <include>**/src/**.xml</include>
                </includes>
                <!-- Files must end with a newline -->
                <endWithNewline />
              </format>
            </formats>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
              <phase>verify</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>com.github.spotbugs</groupId>
          <artifactId>spotbugs-maven-plugin</artifactId>
          <version>4.2.3</version>
          <configuration>
            <includeTests>true</includeTests>
            <effort>Max</effort>
            <threshold>Low</threshold>
            <failOnError>true</failOnError>
            <xmlOutput>true</xmlOutput>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
              <phase>verify</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.2.0</version>
          <configuration>
            <show>private</show>
            <encoding>utf-8</encoding>
            <!--
            Generated proto classes contains a bug that produce invalid javadoc
            https://github.com/protocolbuffers/protobuf/issues/9612
            However we cannot just exclude the flyteidl.* package because maven central demands
            javadocs-jars
            -->
            <failOnWarnings>false</failOnWarnings>
          </configuration>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <configuration>
            <encoding>utf-8</encoding>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.0.1</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>3.1.1</version>
          <configuration>
            <configLocation>checkstyle.xml</configLocation>
            <consoleOutput>true</consoleOutput>
            <!-- Remove or switch to false to keep building even with checkstyle errors -->
            <failOnViolation>true</failOnViolation>
            <logViolationsToConsole>true</logViolationsToConsole>
            <encoding>utf-8</encoding>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
              <phase>verify</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.rat</groupId>
          <artifactId>apache-rat-plugin</artifactId>
          <version>0.13</version>
          <configuration>
            <includes>
              <include>**/*.java</include>
              <include>**/*.xml</include>
            </includes>
            <excludes>
              <!-- Generated during build to shade dependencies -->
              <exclude>**/dependency-reduced-pom.xml</exclude>
              <exclude>**/target/checkstyle-result.xml</exclude>
              <exclude>**/target/javadoc-bundle-options/javadoc-options-javadoc-resources.xml</exclude>
            </excludes>
          </configuration>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
              <phase>verify</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>net.alchim31.maven</groupId>
          <artifactId>scala-maven-plugin</artifactId>
          <version>4.7.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.0.0-M3</version>
          <executions>
            <execution>
              <id>enforce</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <rules>
                  <requireMavenVersion>
                    <version>[3.5.4,)</version>
                  </requireMavenVersion>
                  <requireUpperBoundDeps />
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.2.0</version>
          <configuration>
            <outputDirectory>${project.build.directory}/lib</outputDirectory>
          </configuration>
          <executions>
            <execution>
              <id>default-jar</id>
              <goals>
                <goal>jar</goal>
              </goals>
              <phase>prepare-package</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>3.1.2</version>
          <configuration>
            <outputDirectory>${project.build.directory}/lib</outputDirectory>
            <useBaseVersion>false</useBaseVersion>
            <overWriteReleases>false</overWriteReleases>
            <overWriteSnapshots>true</overWriteSnapshots>
            <includeScope>runtime</includeScope>
          </configuration>
          <executions>
            <execution>
              <id>copy-dependencies</id>
              <goals>
                <goal>copy-dependencies</goal>
              </goals>
              <phase>package</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>com.google.cloud.tools</groupId>
          <artifactId>jib-maven-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <version>3.0.0-M4</version>
        <configuration>
          <preparationGoals>clean spotless:apply</preparationGoals>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <allowTimestampedSnapshots>false</allowTimestampedSnapshots>
          <tagNameFormat>@{project.version}</tagNameFormat>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <!-- Based on: https://central.sonatype.org/pages/apache-maven.html-->
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <goals>
                  <goal>sign</goal>
                </goals>
                <phase>verify</phase>
                <configuration>
                  <gpgArguments>
                    <arg>--batch</arg>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.2.1</version>
            <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>
            <version>3.3.1</version>
            <configuration>
              <source>8</source>
              <doclint>all,-missing</doclint>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.8</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>errorprone</id>
      <activation>
        <property>
          <name>!errorprone.skip</name>
        </property>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
              <configuration>
                <compilerArgs combine.children="append">
                  <arg>-XDcompilePolicy=simple</arg>
                  <arg>${error-prone-base-config} ${error-prone-additional-args}</arg>
                </compilerArgs>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>
</project>
