<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">

	<properties>
		<java.version>1.8</java.version>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
	</properties>

	<modelVersion>4.0.0</modelVersion>
	<groupId>nl.topicus</groupId>
	<artifactId>spanner-jdbc</artifactId>
	<version>0.16</version>
	<name>spanner-jdbc</name>
	<description>JDBC Driver for Google Cloud Spanner</description>
	<url>https://github.com/olavloite/spanner-jdbc</url>
	<packaging>jar</packaging>
	<licenses>
		<license>
			<name>MIT License</name>
			<url>http://www.opensource.org/licenses/mit-license.php</url>
		</license>
	</licenses>
	<developers>
		<developer>
			<name>Knut Olav Loite</name>
			<email>koloite@gmail.com</email>
			<organization>Topicus</organization>
			<organizationUrl>http://www.topicus.nl</organizationUrl>
		</developer>
	</developers>
	<scm>
		<connection>scm:git:git://github.com/olavloite/spanner-jdbc.git</connection>
		<developerConnection>scm:git:git@github.com:olavloite/spanner-jdbc.git</developerConnection>
		<url>https://github.com/olavloite/spanner-jdbc</url>
		<tag>spanner-jdbc-0.16</tag>
	</scm>

	<dependencies>
		<dependency>
			<groupId>com.google.cloud</groupId>
			<artifactId>google-cloud-spanner</artifactId>
			<version>0.21.1-beta</version>
			<exclusions>
				<exclusion> <!-- exclude an old version of Guava -->
					<groupId>com.google.guava</groupId>
					<artifactId>guava-jdk5</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>20.0</version>
		</dependency>
		<dependency>
			<groupId>com.github.jsqlparser</groupId>
			<artifactId>jsqlparser</artifactId>
			<version>1.1</version>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<version>2.9.0</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<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>
	<build>
		<resources>
			<resource>
				<directory>src/main/java</directory>
				<filtering>false</filtering>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>false</filtering>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<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>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.20</version>
				<dependencies>
					<dependency>
						<groupId>org.apache.maven.surefire</groupId>
						<artifactId>surefire-junit47</artifactId>
						<version>2.20</version>
					</dependency>
				</dependencies>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<version>2.20</version>
				<dependencies>
					<dependency>
						<groupId>org.apache.maven.surefire</groupId>
						<artifactId>surefire-junit47</artifactId>
						<version>2.20</version>
					</dependency>
				</dependencies>
				<executions>
					<execution>
						<id>default-integration-test</id>
						<goals>
							<goal>integration-test</goal>
						</goals>
					</execution>
				</executions>
			</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>
								<!-- implementation is needed only for Maven 2 -->
								<rule implementation="org.jacoco.maven.RuleConfiguration">
									<element>BUNDLE</element>
									<limits>
										<!-- implementation is needed only for Maven 2 -->
										<limit implementation="org.jacoco.report.check.Limit">
											<counter>COMPLEXITY</counter>
											<value>COVEREDRATIO</value>
											<minimum>0.05</minimum>
										</limit>
									</limits>
								</rule>
							</rules>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
	<profiles>
		<profile>
			<id>single-jar</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-shade-plugin</artifactId>
						<version>3.0.0</version>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>shade</goal>
								</goals>
								<configuration>
									<createSourcesJar>true</createSourcesJar>
									<shadeSourcesContent>true</shadeSourcesContent>
									<shadedArtifactAttached>false</shadedArtifactAttached>
									<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
									<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
									<artifactSet>
										<includes>
											<include>*:*</include>
										</includes>
										<excludes>
											<exclude>java:*</exclude>
											<exclude>junit:*</exclude>
										</excludes>
									</artifactSet>
									<transformers>
										<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
									</transformers>
									<relocations>
										<relocation>
											<pattern>javax.annotation.</pattern>
											<shadedPattern>nl.topicus.jdbc.shaded.javax.annotation.</shadedPattern>
										</relocation>
										<relocation>
											<pattern>javax.inject.</pattern>
											<shadedPattern>nl.topicus.jdbc.shaded.javax.inject.</shadedPattern>
										</relocation>
										<relocation>
											<pattern>javax.jdo.</pattern>
											<shadedPattern>nl.topicus.jdbc.shaded.javax.jdo.</shadedPattern>
										</relocation>
										<relocation>
											<pattern>javax.annotation.</pattern>
											<shadedPattern>nl.topicus.jdbc.shaded.javax.annotation.</shadedPattern>
										</relocation>
										<relocation>
											<pattern>javax.servlet.</pattern>
											<shadedPattern>nl.topicus.jdbc.shaded.javax.servlet.</shadedPattern>
										</relocation>
										<relocation>
											<pattern>javax.transaction.</pattern>
											<shadedPattern>nl.topicus.jdbc.shaded.javax.transaction.</shadedPattern>
										</relocation>
										<relocation>
											<pattern>com.</pattern>
											<shadedPattern>nl.topicus.jdbc.shaded.com.</shadedPattern>
										</relocation>
										<relocation>
											<pattern>net.</pattern>
											<shadedPattern>nl.topicus.jdbc.shaded.net.</shadedPattern>
										</relocation>
										<relocation>
											<pattern>io.netty.internal</pattern>
											<shadedPattern>io.netty.internal</shadedPattern>
										</relocation>
										<relocation>
											<pattern>io.</pattern>
											<shadedPattern>nl.topicus.jdbc.shaded.io.</shadedPattern>
										</relocation>
										<!-- <relocation> <pattern>google.</pattern> <shadedPattern>nl.topicus.jdbc.shaded.google.</shadedPattern> 
											</relocation> -->
										<relocation>
											<pattern>autovalue.</pattern>
											<shadedPattern>nl.topicus.jdbc.shaded.autovalue.</shadedPattern>
										</relocation>
										<relocation>
											<pattern>org.</pattern>
											<shadedPattern>nl.topicus.jdbc.shaded.org.</shadedPattern>
										</relocation>
									</relocations>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<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>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://oss.sonatype.org/</nexusUrl>
							<autoReleaseAfterClose>true</autoReleaseAfterClose>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<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>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>2.9.1</version>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>