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

    Copyright 2017 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.3.0</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-parent-0.3.0</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.0.0</build-helper-maven-plugin.version>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
        <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
        <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
        <maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
        <maven-bundle-plugin.version>4.1.0</maven-bundle-plugin.version>
        <maven-checkstyle-plugin.version>3.0.0</maven-checkstyle-plugin.version>
        <maven-shade-plugin.version>3.2.1</maven-shade-plugin.version>
        <maven-dependency-plugin.version>3.1.1</maven-dependency-plugin.version>
        <depends-maven-plugin.version>1.4.0</depends-maven-plugin.version>
        <os-maven-plugin.version>1.6.1</os-maven-plugin.version>
        <protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
        <jacoco-maven-plugin.version>0.8.2</jacoco-maven-plugin.version>
        <com-puppycrawl-tools.version>8.16</com-puppycrawl-tools.version>
        <com-puppycrawl-tools-guava.version>27.0.1-jre</com-puppycrawl-tools-guava.version>
        <exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
        <license-maven-plugin.version>3.0</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.7.1</maven-site-plugin.version>
        <maven-surefire-plugin.version>2.22.1</maven-surefire-plugin.version>
        <directory-maven-plugin.version>0.3.1</directory-maven-plugin.version>
        <versions-maven-plugin.version>2.7</versions-maven-plugin.version>
        <maven-release-plugin.version>2.5.3</maven-release-plugin.version>

        <!-- dependencies -->
        <grpc.version>1.17.1</grpc.version>
        <slf4j.version>1.7.25</slf4j.version>
        <plexus-compiler-javac-errorprone.version>2.8.5</plexus-compiler-javac-errorprone.version>
        <error-prone-core.version>2.3.2</error-prone-core.version>
        <log4j2.version>2.11.1</log4j2.version>
        <jcommander.version>1.72</jcommander.version>
        <jool.version>0.9.14</jool.version>
        <!-- should be in sync with protobuf grpc dependencies -->
        <protobuf.version>3.5.1</protobuf.version>

        <!-- osgi dependencies -->
        <karaf.version>4.2.2</karaf.version>
        <osgi.ds.version>1.4.0</osgi.ds.version>
        <pax.exam.version>4.13.1</pax.exam.version>

        <!-- test dependencies -->
        <testng.version>6.14.3</testng.version>
        <mockito.version>2.23.4</mockito.version>
        <assertj.version>3.11.1</assertj.version>
        <junit.version>4.12</junit.version>
        <netty-tcnative.version>2.0.20.Final</netty-tcnative.version>
        <testcontainers.version>1.10.5</testcontainers.version>
        <commons-io.version>2.6</commons-io.version>
    </properties>

    <modules>
        <module>jetcd-launcher</module>
        <module>jetcd-launcher-maven-plugin</module>
        <module>jetcd-common</module>
        <module>jetcd-launcher-maven-plugin-test</module>
        <module>jetcd-resolver</module>
        <module>jetcd-resolver-dns-srv</module>
        <module>jetcd-core</module>
        <module>jetcd-extensions</module>
        <module>jetcd-all</module>
        <module>jetcd-osgi</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-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-resolver</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>jetcd-resolver-dns-srv</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>${project.groupId}</groupId>
                <artifactId>jetcd-osgi</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>jetcd-karaf</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-core</artifactId>
                <version>${grpc.version}</version>
            </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>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.testng</groupId>
                <artifactId>testng</artifactId>
                <version>${testng.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${slf4j.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
              <groupId>io.grpc</groupId>
              <artifactId>grpc-testing</artifactId>
              <version>${grpc.version}</version>
              <scope>test</scope>
            </dependency>
            <dependency>
              <groupId>io.netty</groupId>
              <artifactId>netty-tcnative-boringssl-static</artifactId>
              <version>${netty-tcnative.version}</version>
              <scope>test</scope>
            </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>
        </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>
                    </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>
                </plugin>

                <!--
                    generate maven dependencies versions file that can be used later
                    to install the right bundle in test phase.

                    The file is:

                        ${project.build.directory}/classes/META-INF/maven/dependencies.properties
                -->
                <plugin>
                    <groupId>org.apache.servicemix.tooling</groupId>
                    <artifactId>depends-maven-plugin</artifactId>
                    <version>${depends-maven-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>generate-depends-file</id>
                            <goals>
                                <goal>generate-depends-file</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>${maven-bundle-plugin.version}</version>
                    <extensions>true</extensions>
                </plugin>

                <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>${com-puppycrawl-tools.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>com.google.guava</groupId>
                            <artifactId>guava</artifactId>
                            <version>${com-puppycrawl-tools-guava.version}</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>validate</id>
                            <phase>validate</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <encoding>UTF-8</encoding>
                        <consoleOutput>true</consoleOutput>
                        <failsOnError>true</failsOnError>
                        <failOnViolation>true</failOnViolation>
                        <violationSeverity>warning</violationSeverity>
                        <linkXRef>false</linkXRef>
                    </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>
                        <pluginExecution>
                          <pluginExecutionFilter>
                            <groupId>org.apache.servicemix.tooling</groupId>
                            <artifactId>depends-maven-plugin</artifactId>
                            <versionRange>[1.4.0,)</versionRange>
                            <goals>
                              <goal>generate-depends-file</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>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>${license-maven-plugin.version}</version>
                <configuration>
                    <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.md</exclude>
                        <exclude>NOTICE</exclude>
                        <exclude>DCO</exclude>
                        <exclude>docs/**</exclude>
                        <exclude>.mvn/wrapper/**</exclude>
                        <exclude>mvnw*</exclude>
                        <exclude>etc/license.txt</exclude>
                        <exclude>etc/checkstyle-header-java.txt</exclude>
                        <exclude>src/test/resources/ssl/**</exclude>
                        <exclude>external/**</exclude>
                        <exclude>target-ide/**</exclude>
                    </excludes>
                    <mapping>
                        <proto>DOUBLESLASH_STYLE</proto>
                    </mapping>
                </configuration>
                <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</arguments>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                </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>
                <checkstyle.skip>true</checkstyle.skip>
                <maven.test.skip>true</maven.test.skip>
                <license.skip>true</license.skip>
            </properties>
        </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>false</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>
