<?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>nl.topicus</groupId>
  <artifactId>spanner-jdbc</artifactId>
  <name>spanner-jdbc</name>
  <version>0.26</version>
  <description>JDBC Driver for Google Cloud Spanner</description>
  <url>https://github.com/olavloite/spanner-jdbc</url>
  <developers>
    <developer>
      <name>Knut Olav Loite</name>
      <email>koloite@gmail.com</email>
      <organization>Topicus</organization>
      <organizationUrl>http://www.topicus.nl</organizationUrl>
    </developer>
  </developers>
  <licenses>
    <license>
      <name>MIT License</name>
      <url>http://www.opensource.org/licenses/mit-license.php</url>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:git://github.com/olavloite/spanner-jdbc.git</connection>
    <developerConnection>scm:git:git@github.com:olavloite/spanner-jdbc.git</developerConnection>
    <tag>spanner-jdbc-0.26</tag>
    <url>https://github.com/olavloite/spanner-jdbc</url>
  </scm>
  <build>
    <resources>
      <resource>
        <directory>src/main/java</directory>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.3</version>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <useReleaseProfile>false</useReleaseProfile>
          <releaseProfiles>release</releaseProfiles>
          <goals>deploy</goals>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.20.1</version>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.surefire</groupId>
            <artifactId>surefire-junit47</artifactId>
            <version>2.20.1</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.20.1</version>
        <executions>
          <execution>
            <id>default-integration-test</id>
            <goals>
              <goal>integration-test</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.surefire</groupId>
            <artifactId>surefire-junit47</artifactId>
            <version>2.20.1</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.7.9</version>
        <executions>
          <execution>
            <id>default-prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>default-prepare-agent-integration</id>
            <goals>
              <goal>prepare-agent-integration</goal>
            </goals>
          </execution>
          <execution>
            <id>default-report</id>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
          <execution>
            <id>default-report-integration</id>
            <goals>
              <goal>report-integration</goal>
            </goals>
          </execution>
          <execution>
            <id>default-check</id>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <rules>
                <rule>
                  <element>BUNDLE</element>
                  <limits>
                    <limit>
                      <counter>COMPLEXITY</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.05</minimum>
                    </limit>
                  </limits>
                </rule>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <phase>post-integration-test</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <createSourcesJar>true</createSourcesJar>
              <shadeSourcesContent>true</shadeSourcesContent>
              <shadedArtifactAttached>false</shadedArtifactAttached>
              <createDependencyReducedPom>true</createDependencyReducedPom>
              <artifactSet>
                <includes>
                  <include>*:*</include>
                </includes>
                <excludes>
                  <exclude>java:*</exclude>
                  <exclude>junit:*</exclude>
                </excludes>
              </artifactSet>
              <transformers>
                <transformer />
              </transformers>
              <relocations>
                <relocation>
                  <pattern>javax.annotation.</pattern>
                  <shadedPattern>nl.topicus.jdbc.shaded.javax.annotation.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.google.</pattern>
                  <shadedPattern>nl.topicus.jdbc.shaded.com.google.</shadedPattern>
                  <excludes>
                    <exclude>https://*</exclude>
                  </excludes>
                </relocation>
                <relocation>
                  <pattern>com.fasterxml.</pattern>
                  <shadedPattern>nl.topicus.jdbc.shaded.com.fasterxml.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>net.sf.</pattern>
                  <shadedPattern>nl.topicus.jdbc.shaded.net.sf.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.grpc</pattern>
                  <shadedPattern>nl.topicus.jdbc.shaded.io.grpc</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.opencensus</pattern>
                  <shadedPattern>nl.topicus.jdbc.shaded.io.opencensus</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.netty</pattern>
                  <shadedPattern>nl.topicus.jdbc.shaded.io.netty</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>autovalue.shaded.</pattern>
                  <shadedPattern>nl.topicus.jdbc.shaded.autovalue.shaded.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.</pattern>
                  <shadedPattern>nl.topicus.jdbc.shaded.org.apache.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.hamcrest.</pattern>
                  <shadedPattern>nl.topicus.jdbc.shaded.org.hamcrest.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.joda.</pattern>
                  <shadedPattern>nl.topicus.jdbc.shaded.org.joda.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.json.</pattern>
                  <shadedPattern>nl.topicus.jdbc.shaded.org.json.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.threeten.</pattern>
                  <shadedPattern>nl.topicus.jdbc.shaded.org.threeten.</shadedPattern>
                </relocation>
              </relocations>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.9.1</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>truezip-maven-plugin</artifactId>
        <version>1.2</version>
        <executions>
          <execution>
            <id>move-linux-lib</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>move</goal>
            </goals>
            <configuration>
              <from>${project.build.directory}/${project.build.finalName}.${project.packaging}/META-INF/native/libnetty_tcnative_linux_x86_64.so</from>
              <to>${project.build.directory}/${project.build.finalName}.${project.packaging}/META-INF/native/libnl_topicus_jdbc_shaded_netty_tcnative_linux_x86_64.so</to>
            </configuration>
          </execution>
          <execution>
            <id>move-osx-lib</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>move</goal>
            </goals>
            <configuration>
              <from>${project.build.directory}/${project.build.finalName}.${project.packaging}/META-INF/native/libnetty_tcnative_osx_x86_64.jnilib</from>
              <to>${project.build.directory}/${project.build.finalName}.${project.packaging}/META-INF/native/libnl_topicus_jdbc_shaded_netty_tcnative_osx_x86_64.jnilib</to>
            </configuration>
          </execution>
          <execution>
            <id>move-windows-lib</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>move</goal>
            </goals>
            <configuration>
              <from>${project.build.directory}/${project.build.finalName}.${project.packaging}/META-INF/native/netty_tcnative_windows_x86_64.dll</from>
              <to>${project.build.directory}/${project.build.finalName}.${project.packaging}/META-INF/native/nl_topicus_jdbc_shaded_netty_tcnative_windows_x86_64.dll</to>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.5</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>1.6.7</version>
            <extensions>true</extensions>
            <executions>
              <execution>
                <id>injected-nexus-deploy</id>
                <phase>deploy</phase>
                <goals>
                  <goal>deploy</goal>
                </goals>
                <configuration>
                  <serverId>ossrh</serverId>
                  <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                  <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>2.9.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>byte-buddy</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
        <exclusion>
          <artifactId>byte-buddy-agent</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
        <exclusion>
          <artifactId>objenesis</artifactId>
          <groupId>org.objenesis</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.mchange</groupId>
      <artifactId>c3p0</artifactId>
      <version>0.9.5.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>mchange-commons-java</artifactId>
          <groupId>com.mchange</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <distributionManagement>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>
  <properties>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>
</project>

