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

    Copyright 2016-2021 The jetcd 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>io.etcd</groupId>
    <artifactId>jetcd-parent</artifactId>
    <version>0.5.7</version>
    <name>jetcd</name>
    <description>Java Client for etcd V3</description>
    <url>https://github.com/etcd-io/jetcd</url>
    <packaging>pom</packaging>

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

    <developers>
        <developer>
            <name>Fanmin Shi</name>
            <email>fanmin.shi@coreos.com</email>
            <organization>coreos</organization>
            <organizationUrl>http://coreos.com/</organizationUrl>
        </developer>
        <developer>
            <name>Luca Burgazzoli</name>
            <email>lburgazzoli@gmail.com</email>
            <organization>redhat</organization>
            <organizationUrl>http://redhat.com/</organizationUrl>
        </developer>
        <developer>
            <name>Xiang Li</name>
            <email>xiang.li@coreos.com</email>
            <organization>coreos</organization>
            <organizationUrl>http://coreos.com/</organizationUrl>
        </developer>
        <developer>
            <name>Anthony Romano</name>
            <email>anthony.romano@coreos.com</email>
            <organization>coreos</organization>
            <organizationUrl>http://coreos.com/</organizationUrl>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/etcd-io/jetcd.git</url>
        <connection>scm:git:git@github.com:etcd-io/jetcd.git</connection>
        <developerConnection>scm:git:git@github.com:etcd-io/jetcd.git</developerConnection>
      <tag>jetcd-0.5.7</tag>
  </scm>

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

        <jdk.version>1.8</jdk.version>

        <!-- plugins -->
        <build-helper-maven-plugin.version>3.2.0</build-helper-maven-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
        <maven-resources-plugin.version>3.2.0</maven-resources-plugin.version>
        <maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
        <maven-shade-plugin.version>3.2.4</maven-shade-plugin.version>
        <maven-dependency-plugin.version>3.1.2</maven-dependency-plugin.version>
        <os-maven-plugin.version>1.7.0</os-maven-plugin.version>
        <protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
        <jacoco-maven-plugin.version>0.8.6</jacoco-maven-plugin.version>
        <exec-maven-plugin.version>3.0.0</exec-maven-plugin.version>
        <license-maven-plugin.version>4.1</license-maven-plugin.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
        <maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
        <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
        <maven-install-plugin.version>2.5.2</maven-install-plugin.version>
        <maven-site-plugin.version>3.9.1</maven-site-plugin.version>
        <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
        <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
        <directory-maven-plugin.version>0.3.1</directory-maven-plugin.version>
        <versions-maven-plugin.version>2.8.1</versions-maven-plugin.version>
        <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
        <formatter-maven-plugin.version>2.15.0</formatter-maven-plugin.version>
        <impsort-maven-plugin.version>1.6.0</impsort-maven-plugin.version>

        <!-- dependencies -->
        <grpc.version>1.37.0</grpc.version>
        <slf4j.version>1.7.30</slf4j.version>
        <plexus-compiler-javac-errorprone.version>2.8.6</plexus-compiler-javac-errorprone.version>
        <error-prone-core.version>2.3.4</error-prone-core.version>
        <log4j2.version>2.14.1</log4j2.version>
        <jcommander.version>1.81</jcommander.version>
        <jool.version>0.9.14</jool.version>
        <guava.version>30.1.1-jre</guava.version>
        <!-- should be in sync with protobuf grpc dependencies -->
        <protobuf.version>3.11.4</protobuf.version>
        <failsafe.version>2.4.0</failsafe.version>
        <spotbugs-annotations.version>4.2.3</spotbugs-annotations.version>
        <!-- test dependencies -->
        <mockito.version>3.9.0</mockito.version>
        <assertj.version>3.19.0</assertj.version>
        <junit.version>4.12</junit.version>
        <junit-jupiter.version>5.7.1</junit-jupiter.version>
        <netty-tcnative.version>2.0.39.Final</netty-tcnative.version>
        <testcontainers.version>1.15.3</testcontainers.version>
        <commons-io.version>2.8.0</commons-io.version>
        <awaitility.version>4.0.3</awaitility.version>
        <auto-service.version>1.0</auto-service.version>
        <javax-annotation-api.version>1.3.2</javax-annotation-api.version>
    </properties>

    <modules>
        <module>jetcd-launcher</module>
        <module>jetcd-test</module>
        <module>jetcd-common</module>
        <module>jetcd-core</module>
        <module>jetcd-extensions</module>
        <module>jetcd-all</module>
        <module>jetcd-examples</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>jetcd-launcher</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>jetcd-test</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>jetcd-common</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>jetcd-extensions</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>jetcd-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>jetcd-all</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-api</artifactId>
                <version>${grpc.version}</version>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-core</artifactId>
                <version>${grpc.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.google.guava</groupId>
                        <artifactId>guava</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-netty</artifactId>
                <version>${grpc.version}</version>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-protobuf</artifactId>
                <version>${grpc.version}</version>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-stub</artifactId>
                <version>${grpc.version}</version>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-grpclb</artifactId>
                <version>${grpc.version}</version>
            </dependency>

            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>

            <dependency>
                <groupId>net.jodah</groupId>
                <artifactId>failsafe</artifactId>
                <version>${failsafe.version}</version>
            </dependency>
            <dependency>
                <groupId>javax.annotation</groupId>
                <artifactId>javax.annotation-api</artifactId>
                <version>${javax-annotation-api.version}</version>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
                <version>${log4j2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>${log4j2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j-impl</artifactId>
                <version>${log4j2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-1.2-api</artifactId>
                <version>${log4j2.version}</version>
            </dependency>

            <dependency>
                <groupId>com.beust</groupId>
                <artifactId>jcommander</artifactId>
                <version>${jcommander.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jooq</groupId>
                <artifactId>jool-java-8</artifactId>
                <version>${jool.version}</version>
            </dependency>

            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.awaitility</groupId>
                <artifactId>awaitility</artifactId>
                <version>${awaitility.version}</version>
            </dependency>
            <dependency>
              <groupId>io.grpc</groupId>
              <artifactId>grpc-testing</artifactId>
              <version>${grpc.version}</version>
            </dependency>
            <dependency>
              <groupId>io.netty</groupId>
              <artifactId>netty-tcnative-boringssl-static</artifactId>
              <version>${netty-tcnative.version}</version>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers</artifactId>
                <version>${testcontainers.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons-io.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>${junit-jupiter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-migrationsupport</artifactId>
                <version>${junit-jupiter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-junit-jupiter</artifactId>
                <version>${mockito.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-annotations</artifactId>
                <version>${spotbugs-annotations.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.auto.service</groupId>
                <artifactId>auto-service</artifactId>
                <version>${auto-service.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.auto.service</groupId>
                <artifactId>auto-service-annotations</artifactId>
                <version>${auto-service.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${maven-clean-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven-deploy-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${maven-install-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${maven-site-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                    <configuration>
                        <systemPropertyVariables>
                            <visibleassertions.silence>true</visibleassertions.silence>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.xolstice.maven.plugins</groupId>
                    <artifactId>protobuf-maven-plugin</artifactId>
                    <version>${protobuf-maven-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>${build-helper-maven-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>test</id>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>add-source</goal>
                            </goals>
                            <configuration>
                                <sources>
                                    <source>${basedir}/${project.build.directory}/generated-sources</source>
                                </sources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <source>${jdk.version}</source>
                        <target>${jdk.version}</target>
                        <encoding>UTF-8</encoding>
                        <compilerId>javac-with-errorprone</compilerId>
                        <forceJavacCompilerUse>true</forceJavacCompilerUse>
                        <compilerArgs>
                            <arg>-Xlint:all</arg>
                            <!-- TODO <arg>-Werror</arg> -->
                            <!-- There are lots of disabled goodies in error-prone which only emit warnings (which nobody will ever look at!),
                                 so let us enable them all as least as warnings, and then selectively turn some of them into ERROR, and suppress
                                 those we really don't want (or can't enforce for whatever reason) with OFF. -->
                            <arg>-XepExcludedPaths:.*/target/.*</arg>

                            <!-- https://github.com/google/error-prone/issues/1138 -->
                            <!-- <arg>-XepAllDisabledChecksAsWarnings</arg> -->
                            -Xep:NullableDereference:OFF

                            <!-- StaticOrDefaultInterfaceMethod is an Android specific warning which we don't care about -->
                            <arg>-Xep:StaticOrDefaultInterfaceMethod:OFF</arg>
                            <!-- FieldMissingNullable is badly broken :( https://github.com/google/error-prone/issues/708 -->
                            <arg>-Xep:FieldMissingNullable:OFF</arg>
                            <!-- To "Use parameter comments to document ambiguous literals" is unrealistic on a large existing code base -->
                            <arg>-Xep:BooleanParameter:OFF</arg>
                            <arg>-Xep:ReturnMissingNullable:ERROR</arg>
                            <arg>-Xep:MethodCanBeStatic:ERROR</arg>
                            <arg>-Xep:TestExceptionChecker:ERROR</arg>
                            <arg>-Xep:RedundantThrows:ERROR</arg>
                            <arg>-Xep:ConstantField:ERROR</arg>
                            <arg>-Xep:EmptySetMultibindingContributions:ERROR</arg>
                            <arg>-Xep:MixedArrayDimensions:ERROR</arg>
                            <arg>-Xep:MultipleTopLevelClasses:ERROR</arg>
                            <arg>-Xep:MultiVariableDeclaration:ERROR</arg>
                            <arg>-Xep:PackageLocation:ERROR</arg>
                            <arg>-Xep:PrivateConstructorForNoninstantiableModule:ERROR</arg>
                            <arg>-Xep:RemoveUnusedImports:ERROR</arg>
                            <arg>-Xep:UnnecessaryStaticImport:ERROR</arg>
                            <arg>-Xep:UseBinds:ERROR</arg>
                            <arg>-Xep:WildcardImport:ERROR</arg>
                            <!-- FutureReturnValueIgnored is better (stronger) than error-prone's own (and FindBug's) @CheckReturnValue annotation,
                                 as it checks that ANY return Future are checked, not just those from methods annotated @CheckReturnValue -->
                            <arg>-Xep:FutureReturnValueIgnored:ERROR</arg>
                            <arg>-Xep:IntLongMath:ERROR</arg>
                            <arg>-Xep:FloatCast:ERROR</arg>
                            <arg>-Xep:ClassNewInstance:ERROR</arg>
                            <arg>-Xep:ConstructorInvokesOverridable:ERROR</arg>
                            <arg>-Xep:ThreeLetterTimeZoneID:ERROR</arg>
                            <arg>-Xep:UnsafeFinalization:ERROR</arg>
                            <arg>-Xep:MutableMethodReturnType:ERROR</arg>
                            <arg>-Xep:SynchronizeOnNonFinalField:ERROR</arg>
                            <arg>-Xep:WaitNotInLoop:ERROR</arg>
                            <arg>-Xep:SwitchDefault:ERROR</arg>
                            <arg>-Xep:ReachabilityFenceUsage:ERROR</arg>
                            <arg>-Xep:BoxedPrimitiveConstructor:ERROR</arg>
                            <arg>-Xep:InjectOnConstructorOfAbstractClass:ERROR</arg>
                            <arg>-Xep:StringSplitter:ERROR</arg>
                            <arg>-Xep:DefaultCharset:ERROR</arg>
                            <arg>-Xep:StreamResourceLeak:ERROR</arg>
                            <arg>-Xep:InconsistentCapitalization:ERROR</arg>
                            <arg>-Xep:TruthIncompatibleType:ERROR</arg>
                            <arg>-Xep:ByteBufferBackingArray:ERROR</arg>
                            <arg>-Xep:OrphanedFormatString:ERROR</arg>
                            <arg>-Xep:CatchAndPrintStackTrace:ERROR</arg>
                            <arg>-Xep:VarTypeName:ERROR</arg>
                            <arg>-Xep:ObjectToString:ERROR</arg>
                            <arg>-Xep:AssertThrowsMultipleStatements:ERROR</arg>
                        </compilerArgs>
                        <annotationProcessorPaths>
                            <path>
                                <groupId>com.google.auto.service</groupId>
                                <artifactId>auto-service</artifactId>
                                <version>${auto-service.version}</version>
                            </path>
                        </annotationProcessorPaths>
                    </configuration>
                    <dependencies>
                        <dependency>
                          <groupId>org.codehaus.plexus</groupId>
                          <artifactId>plexus-compiler-javac-errorprone</artifactId>
                          <version>${plexus-compiler-javac-errorprone.version}</version>
                        </dependency>
                        <!--
                            override plexus-compiler-javac-errorprone's dependency on
                            Error Prone with the latest version
                        -->
                        <dependency>
                          <groupId>com.google.errorprone</groupId>
                          <artifactId>error_prone_core</artifactId>
                          <version>${error-prone-core.version}</version>
                        </dependency>
                  </dependencies>
                </plugin>

                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco-maven-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>prepare-agent</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>report</id>
                            <phase>prepare-package</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>post-unit-test</id>
                            <phase>test</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                            <configuration>
                                <!-- Sets the path to the file which contains the execution data. -->
                                <dataFile>${project.build.directory}/jacoco.exec</dataFile>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven-resources-plugin.version}</version>
                    <configuration>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                    <configuration>
                        <aggregate>true</aggregate>
                        <encoding>UTF-8</encoding>
                        <excludePackageNames>*.protobuf.*</excludePackageNames>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${maven-dependency-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${maven-shade-plugin.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                            <configuration>
                                <transformers>
                                    <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                                </transformers>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>net.revelc.code.formatter</groupId>
                    <artifactId>formatter-maven-plugin</artifactId>
                    <version>${formatter-maven-plugin.version}</version>
                    <configuration>
                        <configFile>${jetcd.project.root}/etc/eclipse-formatter-config.xml</configFile>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>net.revelc.code</groupId>
                    <artifactId>impsort-maven-plugin</artifactId>
                    <version>${impsort-maven-plugin.version}</version>
                    <configuration>
                        <groups>java.,javax.,org.w3c.,org.xml.,junit.</groups>
                        <removeUnused>true</removeUnused>
                        <staticAfter>true</staticAfter>
                        <staticGroups>java.,javax.,org.w3c.,org.xml.,junit.</staticGroups>
                    </configuration>
                </plugin>

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

                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                  <groupId>org.eclipse.m2e</groupId>
                  <artifactId>lifecycle-mapping</artifactId>
                  <version>1.0.0</version>
                  <configuration>
                    <lifecycleMappingMetadata>
                      <pluginExecutions>
                        <pluginExecution>
                          <pluginExecutionFilter>
                            <groupId>kr.motd.maven</groupId>
                            <artifactId>os-maven-plugin</artifactId>
                            <versionRange>[1.6.0,)</versionRange>
                            <goals>
                              <goal>detect</goal>
                            </goals>
                          </pluginExecutionFilter>
                          <action>
                            <execute />
                          </action>
                        </pluginExecution>
                        <pluginExecution>
                          <pluginExecutionFilter>
                            <groupId>org.commonjava.maven.plugins</groupId>
                            <artifactId>directory-maven-plugin</artifactId>
                            <versionRange>[0.3.1,)</versionRange>
                            <goals>
                              <goal>highest-basedir</goal>
                            </goals>
                          </pluginExecutionFilter>
                          <action>
                            <ignore />
                          </action>
                        </pluginExecution>
                        <pluginExecution>
                          <pluginExecutionFilter>
                            <groupId>org.xolstice.maven.plugins</groupId>
                            <artifactId>protobuf-maven-plugin</artifactId>
                            <versionRange>[0.5.1,)</versionRange>
                            <goals>
                              <goal>compile</goal>
                              <goal>compile-custom</goal>
                            </goals>
                          </pluginExecutionFilter>
                          <action>
                            <ignore />
                          </action>
                        </pluginExecution>
                      </pluginExecutions>
                    </lifecycleMappingMetadata>
                  </configuration>
                </plugin>
            </plugins>
        </pluginManagement>


        <plugins>
            <plugin>
                <groupId>org.commonjava.maven.plugins</groupId>
                <artifactId>directory-maven-plugin</artifactId>
                <version>${directory-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>directories</id>
                        <goals>
                            <goal>highest-basedir</goal>
                        </goals>
                        <phase>initialize</phase>
                        <configuration>
                            <property>jetcd.project.root</property>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>format</id>
                        <goals>
                            <goal>format</goal>
                        </goals>
                        <phase>process-sources</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>net.revelc.code</groupId>
                <artifactId>impsort-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>sort-imports</id>
                        <goals>
                            <goal>sort</goal>
                        </goals>
                        <phase>process-sources</phase>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${license-maven-plugin.version}</version>
                <configuration>
                    <properties>
                        <project.inceptionYear>2016</project.inceptionYear>
                    </properties>
                    <header>${jetcd.project.root}/etc/license.txt</header>
                    <excludes>
                        <exclude>**/ErrorCode.java</exclude>
                        <exclude>LICENSE</exclude>
                        <exclude>MAINTAINERS</exclude>
                        <exclude>CONTRIBUTING.md</exclude>
                        <exclude>README.adoc</exclude>
                        <exclude>README.md</exclude>
                        <exclude>README.MD</exclude>
                        <exclude>NOTICE</exclude>
                        <exclude>DCO</exclude>
                        <exclude>docs/**</exclude>
                        <exclude>.mvn/wrapper/**</exclude>
                        <exclude>mvnw*</exclude>
                        <exclude>etc/license.txt</exclude>
                        <exclude>src/test/resources/ssl/**</exclude>
                        <exclude>external/**</exclude>
                        <exclude>target-ide/**</exclude>
                        <exclude>.factorypath</exclude>
                        <exclude>.sdkmanrc</exclude>
                        <exclude>.envrc</exclude>
                        <exclude>**/.cache/**</exclude>
                    </excludes>
                    <headerDefinitions>
                        <headerDefinition>${jetcd.project.root}/etc/license-formatting.xml</headerDefinition>
                    </headerDefinitions>
                    <mapping>
                        <proto>DOUBLESLASH_STYLE</proto>
                        <java>SLASHSTART_WITH_BLANKLINE_STYLE</java>
                    </mapping>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.mycila</groupId>
                        <artifactId>license-maven-plugin-git</artifactId>
                        <!-- make sure you use the same version as license-maven-plugin -->
                        <version>${license-maven-plugin.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven-release-plugin.version}</version>
                <configuration>
                    <arguments>-DskipTests=true -Dmaven.javadoc.failOnError=false</arguments>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                    <tagNameFormat>jetcd-@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>disable-java8-doclint</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <properties>
                <additionalparam>-Xdoclint:none</additionalparam>
            </properties>
        </profile>

        <profile>
            <id>fast</id>
            <properties>
                <maven.test.skip>true</maven.test.skip>
                <license.skip>true</license.skip>
            </properties>
        </profile>

        <profile>
            <id>check-format</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>net.revelc.code.formatter</groupId>
                        <artifactId>formatter-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>format</id>
                                <phase />
                            </execution>
                            <execution>
                                <id>validate</id>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>validate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>net.revelc.code</groupId>
                        <artifactId>impsort-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sort-imports</id>
                                <phase />
                            </execution>
                            <execution>
                                <id>check</id>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>deps</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>versions-maven-plugin</artifactId>
                        <version>${versions-maven-plugin.version}</version>
                        <configuration>
                            <rulesUri>file:///${jetcd.project.root}/etc/versions-rules.xml</rulesUri>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>initialize</phase>
                                <goals>
                                    <goal>display-dependency-updates</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven-javadoc-plugin.version}</version>
                        <configuration>
                            <aggregate>true</aggregate>
                            <encoding>UTF-8</encoding>
                            <excludePackageNames>*.protobuf.*</excludePackageNames>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus-staging-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
          <id>ide</id>
          <activation>
            <property>
              <name>m2e.version</name>
            </property>
          </activation>
          <build>
            <!-- Put the IDE's build output in a folder other than target, so that IDE builds don't interact with Maven builds -->
            <directory>target-ide</directory>
          </build>
        </profile>
    </profiles>

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

</project>
