Skip to content
Snippets Groups Projects
pom.xml 4.7 KiB
Newer Older
<?xml version="1.0" encoding="UTF-8"?>
hxd's avatar
hxd committed

<!--
Copyright (c) 2012-2016 YCSB contributors. All rights reserved.

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. See accompanying
LICENSE file.
-->

hxd's avatar
hxd committed
<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>
  <parent>
hxd's avatar
hxd committed
    <groupId>com.yahoo.ycsb</groupId>
    <artifactId>binding-parent</artifactId>
    <version>0.14.0-SNAPSHOT</version>
hxd's avatar
hxd committed
    <relativePath>../binding-parent</relativePath>
hxd's avatar
hxd committed

  <artifactId>cassandra-binding</artifactId>
hxd's avatar
hxd committed
  <name>Cassandra 2.1+ DB Binding</name>
hxd's avatar
hxd committed
  <properties>
    <!-- Skip tests by default. will be activated by jdk8 profile -->
    <skipTests>true</skipTests>
  </properties>

hxd's avatar
hxd committed
    <!-- CQL driver -->
    <dependency>
      <groupId>com.datastax.cassandra</groupId>
      <artifactId>cassandra-driver-core</artifactId>
      <version>${cassandra.cql.version}</version>
    </dependency>
    <dependency>
      <groupId>com.yahoo.ycsb</groupId>
      <artifactId>core</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.cassandraunit</groupId>
      <artifactId>cassandra-unit</artifactId>
      <version>3.0.0.1</version>
      <classifier>shaded</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>1.7.21</version>
      <scope>test</scope>
    </dependency>
hxd's avatar
hxd committed
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <!-- only for Cassandra test (Cassandra 2.2+ uses Sigar for collecting system information, and Sigar requires some native lib files) -->
hxd's avatar
hxd committed
	  <dependency>
hxd's avatar
hxd committed
	    <groupId>org.hyperic</groupId>
	    <artifactId>sigar-dist</artifactId>
	    <version>1.6.4.129</version>
	    <type>zip</type>
	    <scope>test</scope>
hxd's avatar
hxd committed
	  </dependency>
hxd's avatar
hxd committed

  <profiles>
    <!-- Cassandra 2.2+ requires JDK8 to run, so none of our tests
         will work unless we're using jdk8.
      -->
    <profile>
      <id>jdk8-tests</id>
      <activation>
        <jdk>1.8</jdk>
      </activation>
      <properties>
        <skipTests>false</skipTests>
      </properties>
    </profile>
  </profiles>
  <!-- sigar-dist can be downloaded from jboss repository -->
	<repositories>
		<repository>
			<id>central2</id>
			<name>sigar Repository</name>
			<url>http://repository.jboss.org/nexus/content/groups/public-jboss/</url>
			<layout>default</layout>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
	</repositories>
	<!-- unzip sigar-dist/lib files. 
		References: 
		http://stackoverflow.com/questions/5388661/unzip-dependency-in-maven 
		https://arviarya.wordpress.com/2013/09/22/sigar-access-operating-system-and-hardware-level-information/
	 -->
 	<build>
	 	<plugins>
	 		<plugin>
			    <groupId>org.apache.maven.plugins</groupId>
			    <artifactId>maven-dependency-plugin</artifactId>
			    <executions>
			      <execution>
			        <id>unpack-sigar</id>
			        <phase>process-test-resources<!-- or any other valid maven phase --></phase>
			        <goals>
			          <goal>unpack-dependencies</goal>
			        </goals>
			        <configuration>
			          <includeGroupIds>org.hyperic</includeGroupIds>
			          <includeArtifactIds>sigar-dist</includeArtifactIds>
			          <includes>**/sigar-bin/lib/*</includes>
					  <excludes>**/sigar-bin/lib/*jar</excludes>
			          <outputDirectory>
			             ${project.build.directory}/cassandra-dependency
			          </outputDirectory>
			        </configuration>
			      </execution>
			    </executions>
			</plugin>
			<plugin>
			  <groupId>org.apache.maven.plugins</groupId>
			  <artifactId>maven-surefire-plugin</artifactId>
			  <version>2.8</version>
			  <configuration>
			    <argLine>-Djava.library.path=${project.build.directory}/cassandra-dependency/hyperic-sigar-1.6.4/sigar-bin/lib</argLine>
			  </configuration>
			</plugin>
			
	 	</plugins>
 	</build>