<?xml version="1.0" encoding="UTF-8"?>
<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.couchbase.client</groupId>
  <artifactId>couchbase-jdbc-driver</artifactId>
  <name>Couchbase JDBC Driver</name>
  <version>1.0.3</version>
  <description>Couchbase JDBC Driver for Couchbase Analytics</description>
  <url>https://couchbase.com</url>
  <developers>
    <developer>
      <id>peeyush</id>
      <name>Peeyush Gupta</name>
      <email>peeyush.gupta@couchbase.com</email>
    </developer>
    <developer>
      <id>daschl</id>
      <name>Michael Nitschinger</name>
      <email>michael.nitschinger@couchbase.com</email>
    </developer>
    <developer>
      <id>dlychagin-cb</id>
      <name>Dmitry Lychagin</name>
      <email>dmitry.lychagin@couchbase.com</email>
    </developer>
  </developers>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:git://github.com/couchbase/couchbase-jdbc-driver</connection>
    <developerConnection>scm:git:git://github.com/couchbase/couchbase-jdbc-driver</developerConnection>
    <url>https://github.com/couchbase/couchbase-jdbc-driver</url>
  </scm>
  <organization>
    <name>Couchbase, Inc.</name>
    <url>https://couchbase.com</url>
  </organization>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.10.1</version>
        <configuration>
          <release>11</release>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.2</version>
        <configuration>
          <systemPropertyVariables>
            <server.version>${server.version}</server.version>
            <server.build>${server.build}</server.build>
            <cbas.quota>${cbas.quota}</cbas.quota>
          </systemPropertyVariables>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.4.1</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.2.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <version>1.4</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>create</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <getRevisionOnlyOnce>true</getRevisionOnlyOnce>
          <shortRevisionLength>8</shortRevisionLength>
          <attach>true</attach>
          <addOutputDirectoryToResources>true</addOutputDirectoryToResources>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.3.0</version>
        <configuration>
          <archive>
            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
            <manifestEntries>
              <Build-Time>${maven.build.timestamp}</Build-Time>
              <Automatic-Module-Name>com.couchbase.client.jdbc</Automatic-Module-Name>
            </manifestEntries>
            <manifestSections>
              <manifestSection>
                <name>couchbase-jdbc-driver</name>
                <manifestEntries>
                  <Impl-Version>${project.version}</Impl-Version>
                  <Impl-Git-Revision>${buildNumber}</Impl-Git-Revision>
                </manifestEntries>
              </manifestSection>
              <manifestSection>
                <name>com/couchbase/client/jdbc/</name>
                <manifestEntries>
                  <Implementation-Version>${project.version}</Implementation-Version>
                </manifestEntries>
              </manifestSection>
            </manifestSections>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.4.0</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <relocations>
            <relocation>
              <pattern>com.fasterxml.jackson</pattern>
              <shadedPattern>org.apache.asterix.jdbc.core.deps.com.fasterxml.jackson</shadedPattern>
            </relocation>
          </relocations>
          <filters>
            <filter>
              <artifact>*:*</artifact>
              <excludes>
                <exclude>module-info.class</exclude>
                <exclude>META-INF/services/reactor.blockhound.integration.BlockHoundIntegration</exclude>
              </excludes>
            </filter>
            <filter>
              <artifact>com.fasterxml.jackson.core:*</artifact>
              <excludes>
                <exclude>META-INF/maven/com.fasterxml.jackson.core/*/pom.properties</exclude>
                <exclude>META-INF/maven/com.fasterxml.jackson.core/*/pom.xml</exclude>
                <exclude>META-INF/services/**</exclude>
                <exclude>META-INF/NOTICE</exclude>
                <exclude>META-INF/LICENSE</exclude>
                <exclude>META-INF/MANIFEST.MF</exclude>
                <exclude>META-INF/versions/9/**</exclude>
              </excludes>
            </filter>
            <filter>
              <artifact>org.apache.asterix:*</artifact>
              <excludes>
                <exclude>META-INF/NOTICE</exclude>
                <exclude>META-INF/LICENSE</exclude>
                <exclude>META-INF/MANIFEST.MF</exclude>
              </excludes>
            </filter>
            <filter>
              <artifact>org.reactivestreams:reactive-streams</artifact>
              <excludes>
                <exclude>META-INF/MANIFEST.MF</exclude>
              </excludes>
            </filter>
            <filter>
              <artifact>io.projectreactor:reactor-core</artifact>
              <excludes>
                <exclude>META-INF/MANIFEST.MF</exclude>
              </excludes>
            </filter>
            <filter>
              <artifact>com.couchbase.client:java-client</artifact>
              <excludes>
                <exclude>META-INF/MANIFEST.MF</exclude>
              </excludes>
            </filter>
            <filter>
              <artifact>com.couchbase.client:core-io</artifact>
              <excludes>
                <exclude>META-INF/MANIFEST.MF</exclude>
                <exclude>META-INF/NOTICE</exclude>
                <exclude>META-INF/LICENSE</exclude>
                <exclude>META-INF/NOTICE.txt</exclude>
                <exclude>META-INF/LICENSE.txt</exclude>
                <exclude>META-INF/versions/9/**</exclude>
              </excludes>
            </filter>
          </filters>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
            <configuration>
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.13</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>${autoReleaseAfterClose}</autoReleaseAfterClose>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>3.1.0</version>
            <executions>
              <execution>
                <id>enforce-release</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireReleaseVersion>
                      <message>Not a release version (remove -SNAPSHOT suffix!)</message>
                    </requireReleaseVersion>
                    <requireReleaseDeps>
                      <message>Can't release with snapshot dependencies!</message>
                    </requireReleaseDeps>
                  </rules>
                  <fail>true</fail>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <properties>
        <gpg.skip>false</gpg.skip>
      </properties>
    </profile>
    <profile>
      <id>snapshot</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>3.1.0</version>
            <executions>
              <execution>
                <id>enforce-no-releases</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireSnapshotVersion>
                      <message>Not a snapshot version</message>
                    </requireSnapshotVersion>
                  </rules>
                  <fail>true</fail>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <properties>
        <gpg.skip>false</gpg.skip>
      </properties>
    </profile>
  </profiles>
  <repositories>
    <repository>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots />
      <id>snapshots-repo</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
  </repositories>
  <dependencies>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>5.9.1</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>junit-jupiter-api</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-jupiter-params</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-jupiter-engine</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>testcontainers</artifactId>
      <version>1.16.3</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>junit</artifactId>
          <groupId>junit</groupId>
        </exclusion>
        <exclusion>
          <artifactId>slf4j-api</artifactId>
          <groupId>org.slf4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>commons-compress</artifactId>
          <groupId>org.apache.commons</groupId>
        </exclusion>
        <exclusion>
          <artifactId>duct-tape</artifactId>
          <groupId>org.rnorth.duct-tape</groupId>
        </exclusion>
        <exclusion>
          <artifactId>docker-java-api</artifactId>
          <groupId>com.github.docker-java</groupId>
        </exclusion>
        <exclusion>
          <artifactId>docker-java-transport-zerodep</artifactId>
          <groupId>com.github.docker-java</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>couchbase</artifactId>
      <version>1.16.3</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
  </distributionManagement>
  <properties>
    <couchbase-sdk.version>3.4.4</couchbase-sdk.version>
    <asterix-jdbc.version>0.9.8</asterix-jdbc.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <server.version>7.1.3</server.version>
    <gpg.skip>true</gpg.skip>
    <server.build>3481</server.build>
    <autoReleaseAfterClose>true</autoReleaseAfterClose>
    <cbas.quota>1200</cbas.quota>
    <test-containers.version>1.16.3</test-containers.version>
  </properties>
</project>
